Skip to content

Instantly share code, notes, and snippets.

@elston
Created January 6, 2016 14:45
Show Gist options
  • Select an option

  • Save elston/36a03f750b6ded153c5f to your computer and use it in GitHub Desktop.

Select an option

Save elston/36a03f750b6ded153c5f to your computer and use it in GitHub Desktop.
#!/bin/bash
src="./$1/src/"
fix="./$1/fix/"
a=`ls $src|sort -V`
i=0
for fullfile in $a; do
filename=$(basename "$fullfile")
extension="${filename##*.}"
# ...
if [[ $extension == 'jpg' ]]; then
((i++))
printf -v j "%05d" $i
ffix=$fix"$j".JPG
fsrc=$src"$fullfile"
#...
convert -rotate -90 "$fsrc" "$ffix"
echo "$fsrc" "$ffix"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment