[R] OT UNIX grep question

francoisromain at free.fr francoisromain at free.fr
Thu Aug 10 22:25:55 CEST 2006


Selon Rolf Turner <rolf at erdos.math.unb.ca>:

> francoisromain at free.fr 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!)
>

Hi,

Sorry for inconvenience, both are working on my fedora gnu/linux bash, Jan gave
the explanation (Thanks!).

BTW, did you really think I didn't try the double quote call ?
But do not hesitate if **you** see something **I** should learn.

Cheers,

Romain



More information about the R-help mailing list