home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10458 < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.5 KB  |  47 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!seas.smu.edu!utacfd.uta.edu!news.oc.com!convex!tchrist
  3. From: Tom Christiansen <tchrist@convex.COM>
  4. Subject: Re: specifying range in awk
  5. Originator: tchrist@pixel.convex.com
  6. Sender: usenet@news.eng.convex.com (news access account)
  7. Message-ID: <1992Aug28.040643.9482@news.eng.convex.com>
  8. Date: Fri, 28 Aug 1992 04:06:43 GMT
  9. Reply-To: tchrist@convex.COM (Tom Christiansen)
  10. References: <1992Aug28.013050.21408@hp9000.csc.cuhk.hk>
  11. Nntp-Posting-Host: pixel.convex.com
  12. Organization: Convex Computer Corporation, Colorado Springs, CO
  13. X-Disclaimer: This message was written by a user at CONVEX Computer
  14.               Corp. The opinions expressed are those of the user and
  15.               not necessarily those of CONVEX.
  16. Lines: 29
  17.  
  18. From the keyboard of b130778@hp9000.csc.cuhk.hk (MA NGAI LING):
  19. :
  20. :            I have a file looking like the following:
  21. :
  22. :aaaa
  23. :bbbb
  24. :cccc
  25. :dddd
  26. :eeee
  27. :aaaa
  28. :bbbb
  29. :bbbbb
  30. :cccc
  31. :
  32. :        I would like to use awk or sed or something else to get all   
  33. :ocurrence of a and anything between "c" and "e".  I tried 'a|c,e' and
  34. :other combination in awk without much joy.  Is there any way to do it?
  35. :Thanks in advance.
  36.  
  37. Anything wrong with:
  38.  
  39.     sed -ne '/a/,/[ce]/p'
  40.  
  41. --tom
  42. -- 
  43.     Tom Christiansen      tchrist@convex.com      convex!tchrist
  44. "I sincerely hope that the future does not mean we must continually restrict
  45.  ourselves to the tools that were available 10 years ago."
  46.     Mark Bush in comp.unix.wizards <4235@inca.comlab.ox.ac.uk>
  47.