#!/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