Below is a simple script that I came up with today since I had to change the extension for a bunch of files. Thanks to original author for the script, I just added interactive touch to it.
for f in *.$1; do
mv -- "$f" "${f%.$1}.$2"
done
The script can be run as below -
./script old_extn new_extn
for f in *.$1; do
mv -- "$f" "${f%.$1}.$2"
done
The script can be run as below -
./script old_extn new_extn
No comments:
Post a Comment