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
signature.asc
Description: Digital signature
/* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
