Skip to content

Instantly share code, notes, and snippets.

@goyalankit
Created January 13, 2014 06:01
Show Gist options
  • Save goyalankit/8395379 to your computer and use it in GitHub Desktop.
Save goyalankit/8395379 to your computer and use it in GitHub Desktop.
#!/bin/bash
if ( test "$1" == "" ); then
echo "prefix of each image is empty.";
echo "Do you want to continue?";
read response;
if (( ("$response" != "y") || ("$response" != "Y") )); then
exit 1;
fi
fi
COUNTER=0
for file in *.JPG
do
mv "$file" "$1$COUNTER.JPG"
let COUNTER=COUNTER+1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment