Help me make it shut up please!

Hans Fugal hans at fugal.net
Fri Mar 10 14:58:43 MST 2006


On Fri, 10 Mar 2006 at 13:05 -0700, Corey Edwards wrote:
> I saw a number of responses but wasn't sure if any of them had worked
> for you or not, so here's my candidate.
> 
>         $ for i in $(find . -name \*.cc -o -name \*.h); do echo >>${i};
>         done
> 
> It does have the side affect of adding newlines even to files that have
> them, but what's an extra character between friends?

This is a great usage of $() but you made the perfect world assumption
of no spaces. Not really a safe assumption for a directory structure
coming from windows. Here it is tweaked:

    $ find . -name \*.cc -o -name \*.h | while read i; do echo >>${i}; done

-- 
Hans Fugal ; http://hans.fugal.net
 
There's nothing remarkable about it. All one has to do is hit the 
right keys at the right time and the instrument plays itself.
    -- Johann Sebastian Bach
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://plug.org/pipermail/plug/attachments/20060310/d9993b88/attachment.bin 


More information about the PLUG mailing list