Distroname and release: Linux / Unix

Convert extensions on filenames

#!/bin/sh
echo "What extension do you want to convert ? (without .)" 
read from
echo "What do you want to conver them to ?(without .)"
read to

if [ $from = $to ]; then
	echo "NO RENAME NEEDED: File extensions are the same..."
	echo "exiting"
	exit 0
else
for file in *.$from
do
	mv $file `basename $file .$from`.$to
done
echo "converted .$from to .$to"
fi

Do not trust the authors words! POC, tests and experience is key

Copyright LinuxLasse.net 2009 - 2024 All Rights Reserved.

Valid HTML 4.01 Strict Valid CSS!