[CLUE-Tech] bash and spaces

David Anselmi anselmi at anselmi.us
Tue Nov 9 11:56:26 MST 2004


Greg Knaddison wrote:

> Maybe find will work better for you scenario:
> 
> find / -name WS_FTP.LOG -exec cat {} \; >> ~root/WS_FTP_ALLL2.LOG

It's usually better to use xargs with find rather than -exec.  Then you 
can use find's -print0 and xargs's -0 and voila.

> On Tue, 09 Nov 2004 13:12:53 -0500, Angelo Bertolli
> <angelo at freeshell.org> wrote:
> 
>>Can someone explain why this has a problem with spaces in the filename?
>>
>>for log in `locate WS_FTP.LOG`; do cat "$log" >> ~root/WS_FTP_ALL2.LOG; done

Seems like this should be a FAQ.  But let me see if I can figure it out 
again.

Dave




More information about the clue-tech mailing list