home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!wupost!spool.mu.edu!yale.edu!jvnc.net!princeton!mccc!pjh
- From: pjh@mccc.edu (Pete Holsberg)
- Subject: Re: searching a file
- Organization: The College On The Other Side Of Route One
- Date: Mon, 4 Jan 1993 15:37:26 GMT
- Message-ID: <C0C62G.3B5@mccc.edu>
- References: <1993Jan3.021839.10462@mnemosyne.cs.du.edu> <1993Jan03.070721.14178@jpradley.jpr.com> <1993Jan4.015530.23571@Princeton.EDU>
- Lines: 16
-
- In article <1993Jan4.015530.23571@Princeton.EDU> lhjensen@fish.Princeton.EDU (Leif Jensen) writes:
- =In article <1993Jan03.070721.14178@jpradley.jpr.com> jpr@jpradley.jpr.com (Jean-Pierre Radley) writes:
- =>Here's a command to print all words in /usr/dict/words having 1, 2 or 3 "l"s:
- =>
- =></usr/dict/words tr '[A-Z]' '[a-z]' |
- =>sed -n '
- =>/^\([^l]*l[^l]*\)\1\{0,2\}$/p
- =>'
- =
- =Here is a method using awk:
- =
- =awk -Fl 'NF >= 2 && NF <= 4' < /usr/dict/words
- =
- =Actually, I *think* your sed command is invalid.
-
- You're right. J-P's script finds words that have more than 3 ells.
-