home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!seas.smu.edu!utacfd.uta.edu!news.oc.com!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: specifying range in awk
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Message-ID: <1992Aug28.040643.9482@news.eng.convex.com>
- Date: Fri, 28 Aug 1992 04:06:43 GMT
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- References: <1992Aug28.013050.21408@hp9000.csc.cuhk.hk>
- Nntp-Posting-Host: pixel.convex.com
- Organization: Convex Computer Corporation, Colorado Springs, CO
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 29
-
- From the keyboard of b130778@hp9000.csc.cuhk.hk (MA NGAI LING):
- :
- : I have a file looking like the following:
- :
- :aaaa
- :bbbb
- :cccc
- :dddd
- :eeee
- :aaaa
- :bbbb
- :bbbbb
- :cccc
- :
- : I would like to use awk or sed or something else to get all
- :ocurrence of a and anything between "c" and "e". I tried 'a|c,e' and
- :other combination in awk without much joy. Is there any way to do it?
- :Thanks in advance.
-
- Anything wrong with:
-
- sed -ne '/a/,/[ce]/p'
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
- "I sincerely hope that the future does not mean we must continually restrict
- ourselves to the tools that were available 10 years ago."
- Mark Bush in comp.unix.wizards <4235@inca.comlab.ox.ac.uk>
-