Re: Maybe offtopic: Dealing with filenames with blanks in a script
On Wednesday 28 April 2004 00:13, Justin Guerin wrote:
[...]
> I've had similar problems, and I ended up doing something like this:
> # find . -type f -print0 | xargs -0 -i <command> <options> {}
>
> The print0 argument to find uses a null character to signify the end
> of the string, and the -0 argument to xargs tells it to look for that
> null, so spaces are treated just like a-z.
Does that mean I could have a script to convert all those horrible
filenames people give you from the dark side - the ones like
"Some Thoughts About Your Proposition.doc". A simple script to replace
all the spaces with underscores. Or better, to concatenate and if
necessary capitalise just selected words (so that if I called it on the
example above like this: 'moniker Som* 4 5' it would rename that file
"YourProposition.doc". Could be a vital utility for those dealing
regularly with the Gates fan club.
--
richard
Reply to: