How to rename a file with spaces stripped from the name


Handle the irritating situation where people created files (hint: under Windows), with spaces in the filenames, and the Unix/Linux script that wants to process them doesn't have double-quotishness to handle this.

  DESIRED=*.doc
  for F in $DESIRED ; do
    FF=`echo $F |tr -d ' '`
    mv "$F" $FF
  done


keywords: howto,stip,spaces
date: 11/14/2007