Andrew Lentvorski wrote:
> Tyrion wrote:
>> I use the following in a script to remove spaces from filenames:
>>
>> for i in *; do mv "$i" `echo $i | tr " " "_"`; done
>>
>>
>>
>> This of course only works in the current directory, how would I make it
>> do all files in subdirectories as well?
>
> Try "find" with -exec
>
> -a
>
>
Tried all sorts of variations of find with -exec and couldn't get
anything to work, can someone give me an example?
Here's the one I thought would work, but tr doesn't seem to work this way
find -type f -exec mv '{}' `echo '{}' | tr " " "_"` \;
Tyrion
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list