nix, shell, perl, php, mysql and mac os x tips and tricks

Friday, October 28, 2011

Shell Script to re-name file extensions

OLDEXT=${2/#.}
for file in *.jpg ; do mv $file `echo $file | sed 's/\(.*\.\)jpg/\1png/'` ; done