Originally Posted by
bugmenot
ls *.done | while read line ; do mv $line $(basename $line .done) ; done
You don't need ls.
You don't need basename (an external command).
Your script will fail if any filenames contain spaces, because you haven't quoted "$line" and "$(basename $line .done)"
for file in *.done
do
mv "$file" "${file%.done}"
done
Last edited by cfajohnson; Jan 25th, 2009 at 10:09 am.