On Thu, Aug 10, 2006 at 08:51:36AM -0300, Rolf Turner wrote:
> [EMAIL PROTECTED] wrote:
> 
> > You have to learn about regular expressions. Then you'll come up with
> > something like :
> > 
> > grep "^dog$" /usr/share/dict/words
> 
> *You* have to learn about shell syntax.  The foregoing doesn't
> work; it gives an ``Illegal variable name.'' error.  To protect
> against the shell interpretation of the dollar sign you have
> to use *single* quotes.
> 
>               grep '^dog$' /usr/share/dict/words
> 
> *does* work.  (Try it!)

you're perfectly right about single quotes being the correct thing to use
here, but not all shells are insisting on linguistic correctness the way
[t]csh does. bash leaves constructs that it cannot expand as they are, so
the variant with double quotes does work as expected with bash (although
through a mechanism that might be unexpected by most).

Best regards, Jan
-- 
 +- Jan T. Kim -------------------------------------------------------+
 |             email: [EMAIL PROTECTED]                               |
 |             WWW:   http://www.cmp.uea.ac.uk/people/jtk             |
 *-----=<  hierarchical systems are for files, not for humans  >=-----*

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to