On 11/24/10 12:56 PM, Graham Fawcett wrote:
On Wed, 24 Nov 2010 18:49:23 +0000, Iain Buclaw wrote:
== Quote from Graham Fawcett ([email protected])'s article
$ find /usr/include/d/dmd/ | xargs grep "RAND_MAX.*="
/usr/include/d/dmd/druntime/import/core/stdc/stdlib.di: enum
RAND_MAX = 32767;
/usr/include/d/dmd/druntime/import/core/stdc/stdlib.d:enum RAND_MAX
= 32767;
Why the ugly pipe to xargs?
grep -R "RAND_MAX.*=" /usr/include/d/dmd
I knew someone was going to call me on that. :)
I spend some time on Linux, and some on Solaris. While Solaris has
"ggrep" which supports -R, the Solaris "grep" does not. By force of
habit, I spell it "find/grep" to make scripts more portable.
But it's a kludge. Kids, don't try this at home, "grep -R" is
definitely your friend. :)
I hear that "ack" is also nice, though I don't know if it supports D
sources out of the box. (ack: http://betterthangrep.com/)
Best,
Graham
You guys should use zsh.
grep "RAND_MAX.*=" /usr/include/d/dmd/**/*
Andrei