In article <6kau06.rd.ln at wpxx02.toxi.uni-wuerzburg.de>,
Cornelius Krasel <krasel at wpxx02.toxi.uni-wuerzburg.de> wrote:
>To change filenames with spaces into filenames without spaces, do
>something like the following (should work for a bash-like shell):
>>for i in *\ *
>do
> new=`echo $i|tr -d ' '`
> mv $i $new
>done
>>This will rename all files "with space" in your current directory in
>"withspace". If "withspace" exists, it will be overwritten.
Since you are using GCG, you probably want a csh eequivalent for this,
and you probably don't want it to overwrite existing files, in which
case you want the following:
set noclobber
foreach f (*\ *)
mv $f `echo $f | tr -d ' '`
end
If you want the spaces changed to underscores, rather than removed,
change
tr -d ' '
to
tr ' ' '_'
Tim.