You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
568 B
Bash

#!/bin/sh
# Script
# Software dependencies: imagemagick
# Usage: ./rotate.sh imgs-dir-name pdf-filename
DIR=""
DEG=""
#echo ${#1}
if [ ${#1} -gt 0 ] # check arguments given
then
DIR=$1
echo "Images from $DIR directory are being rotated"
if [ ${#2} -gt 0 ]
then
DEG=$2
for IMG in $DIR* # rotate each $IMG in $DIR n $DEGs
do mogrify -rotate $DEG $IMG
done
else
echo "You forgot to provide the roation value (in degrees) as the second argument"
fi
else
echo "You forgot to provide the images directory as the first argument"
fi