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.
cd target_tree
for name in "`find . -maxdepth 99`"; do
mv "$name" "$name" | sed 's/\ /-/g'
done
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
all.
do
echo "command_is "$name" `"$name" |sed '/\ /-/g'`"
done
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.
Larry
--
My real sig is much better.
.
- Follow-Ups:
- Re: How to change spaces in filenames
- From: John W. Krahn
- Re: How to change spaces in filenames
- From: Chris F.A. Johnson
- Re: How to change spaces in filenames
- 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
- Index(es):
Relevant Pages
|