[R] OT UNIX grep question

francoisromain at free.fr francoisromain at free.fr
Thu Aug 10 10:04:11 CEST 2006


Hi,

You have to learn about regular expressions. Then you'll come up with something
like :

grep "^dog$" /usr/share/dict/words

Cheers,

Romain


Selon Erin Hodgess <hodgess at gator.dt.uh.edu>:

> Dear R People:
>
> I want to use the "grep" command in UNIX/Linux to check
> some words from the dictionary.
>
> Let's say I use:
>
> grep dog /usr/share/dict/words
>
> and I get back
>
> bulldog
> dog
> dogged
>
> and so on.
>
> How could I just get back "dog" with the grep command please?
>
> Thanks,
> Sincerely
> Erin Hodgess
> Associate Professor
> Department of Computer and Mathematical Sciences
> University of Houston - Downtown
> mailto: hodgess at gator.uhd.edu
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list