[H-GEN] Useful not so obvious tips

ben.carlyle at invensys.com ben.carlyle at invensys.com
Mon Oct 25 23:51:06 EDT 2004


Greg Black <gjb at gbch.net>
25/10/2004 07:18 PM
Please respond to general

 
        To:     ben.carlyle at invensys.com
        cc:     general at lists.humbug.org.au
        Subject:        Re: [H-GEN] Useful not so obvious tips


> > On 2004-10-25, ben.carlyle at invensys.com wrote:
> > To pick up the xargs point, lets take David's find -exec example and 
> > convert it to use xargs:
> > $ find . -type f -exec do_something_interesting {} \;
> > becomes
> > $ find . -type f | xargs do_something_interesting
...
> >                                    Be warned, however: Weird filenames 

> > (such as those containing spaces) can upset xargs when used in this 
mode.
> This is why god invented the -print0 option for find and the -0
> option for xargs -- there's a case for making them the defaults,
> certainly in one's typing fingers.

Speaking of companies a number of years behind on the user-interface 
front: The installation of Solaris 9 I run appears to support neither 
option in its standard version of the two utilities. Oh well. I suppose 
I'll just have to spell them as "gfind" and "gxargs" for the forseeable 
future. I suppose they go well enough with gsed and gawk (versions that 
don't balk on long lines!).

Benjamin.
Editing his .kshrc aliases list as we speak...





More information about the General mailing list