Skip to content

Instantly share code, notes, and snippets.

@hannic
Created December 2, 2012 19:39
Show Gist options
  • Save hannic/4190599 to your computer and use it in GitHub Desktop.
Save hannic/4190599 to your computer and use it in GitHub Desktop.
JPGtojpg - regex used by sed command
#!/bin/sh
# regular expression syntax used by the sed command (this syntax is described in more detail in “Regular Expressions Unfettered”)
for i in *.JPG ; do
mv "$i" "$(echo $i | sed 's/\.JPG$/.x/')"
mv "$(echo $i | sed 's/\.JPG$/.x/')" "$(echo $i | sed 's/\.JPG$/.jpg/')"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment