Re: [R] OT UNIX grep question

From: Rolf Turner <rolf_at_erdos.math.unb.ca>
Date: Thu 10 Aug 2006 - 21:51:36 EST


francoisromain@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!)

                        cheers,

				Rolf Turner
				rolf@math.unb.ca

______________________________________________
R-help@stat.math.ethz.ch 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. Received on Thu Aug 10 21:55:24 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 11 Aug 2006 - 08:21:17 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.