home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15146 < prev    next >
Encoding:
Text File  |  1993-01-04  |  1.0 KB  |  27 lines

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