home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!infoserv!incc!jerry
- From: jerry@incc.com (Jerry Rocteur)
- Newsgroups: comp.unix.shell
- Subject: Re: searching for 1st occurrence
- Summary: awk, sed, ed
- Message-ID: <100.8886@incc.com>
- Date: 17 Aug 92 17:25:59 GMT
- References: <15m8aqINN6ci@seven-up.East.Sun.COM> <1992Aug17.001516.29088@news.acns.nwu.edu>
- Organization: InCC.com Perwez Belgium
- Lines: 27
-
- In article <1992Aug17.001516.29088@news.acns.nwu.edu>, navarra@casbah.acns.nwu.edu (John Navarra) writes:
- > In article <MITCH.92Aug16153742@mira.clsi> mitch@clsi (Mitchell N. Perilstein) writes:
- > >
- > >You can just skip the grep and do it in one step:
- > >
- > > awk '/SS2/ {print; exit}' < systems
- > >
- >
- > or, you can just skip awk and do it in sed:
- >
- > sed -n '/123/{p;q;}' filename
- >
- or, you can just skip sed and do it in ed:
-
- echo /123|ed filename
-
- This is very silly and could go on for a while.
- --
- __^__ __^__
- ( ___ )------------------------------------------------------------( ___ )
- | / | Jerry Rocteur Email: jerry@InCC.COM | \ |
- | / | Independent Computer Consultants | \ |
- | / | Phone +32.2.235.7045 +32.81.65.53.58 fax +32.81.65.70.20 | \ |
- | / |--------------------------------------------------------------| \ |
- |___| It's beyond my control. |___|
- (_____)------------------------------------------------------------(_____)
- ^ ^
-