How to change spaces in filenames
- From: larryalk <nobody@xxxxxxxxxxx>
- Date: Fri, 11 Aug 2006 21:03:24 GMT
I would like to change all spaces in filename to dashes but can't
seem to get it working. The sed part works ok.
for name in "`find . -maxdepth 99`"; do
mv "$name" "$name" | sed 's/\ /-/g'
When testing the above with replacement echo statements, I get the
strange result that the the word "command_is" only occurs once at the
beginning of the $name list and the final sed command never appears at
echo "command_is "$name" `"$name" |sed '/\ /-/g'`"
I also tried with tr but cannot figure out how to make tr operate on
my $name variable - it seems to insist on a file.
My real sig is much better.
- Prev by Date: Shell script to mount afp drive as user
- Next by Date: Re: How to change spaces in filenames
- Previous by thread: Shell script to mount afp drive as user
- Next by thread: Re: How to change spaces in filenames