Scott Venier said:
for i in * ; do mv $i `echo $i | sed 's/\(.*\)..\.\(.*\)/\1.\2/'` done
I realise it's probably of little concern when dealing with files, but some 1000 calls to sed vs. using a bash-builtin makes for a huge difference in speed: [orion@tribble(~)] TEXT="stuff to work with" [orion@tribble(~)] time for i in $(seq 1 1000); do OTHER=$(echo $TEXT | sed "s/work/goosnargh/g"); done; echo $OTHER real 0m19.405s user 0m5.010s sys 0m12.310s stuff to goosnargh with [orion@tribble(~)] time for i in $(seq 1 1000); do OTHER=${TEXT/work/goosnargh};done; echo $OTHER real 0m0.204s user 0m0.180s sys 0m0.000s stuff to goosnargh with there's quite a few other builtins that can almost replace sed and cut in most situations. look in bash's manpage under "Parameter Expansion" :) -- Aaron Haviland orion [at] tribble [dot] dyndns [dot] org orion [at] parsed [dot] net Can I get 1 bpm by flashing a mirror?