Home Network Problem

Ray Strode halfline at hawaii.rr.com
Sat Mar 24 13:15:35 PST 2001


> I don't think it's shell specific, but a feature of the grep program
itself.
> I could be wrong, but I'm not gonna go look through the source :-)
Oh it's quite shell specific, unless grep implements some hack, which I
really really doubt.  square brackets are used for selecting multiple
choices on the command line.  like try this:
touch foo boo
ls [fb]oo
It should return both foo and boo.  What happens is the shell sees the
brackets and expands them to include both foo and boo.  It then sends
that result to ls.  If you know any c programming, this would be equivalent
to setting argv[1] to foo and argv[2] to boo before calling main().  That
feature is found in modern shells, but wont' work in all shells (like csh
instance).  Now in your case, you used only one letter in the brackets,
which
is equivalent to not using the brackets at all.

--Ray



More information about the LUAU mailing list