Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE's and grep



<karina.popkova at verizon.net> writes:
> Or do not have the letters a, and e, and i in the same word?

This is the hardest one.  But, assuming one word per line, you can do a
bunch of tests like this:

grep '^[^ae]*i[^ae]*$' /usr/share/dict/words   # words with i but no a or e

That looks for all lines that have i in them, and the i can be surrounded
on either side by any number of characters that are not a or e.

And if you combine the various forms you would need with a bunch of |'s, I
suppose you could do all of your tests in one command, but you might as
well do them separately.

  jj





BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org