home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / shell / 3504 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.5 KB

  1. Path: sparky!uunet!infoserv!incc!jerry
  2. From: jerry@incc.com (Jerry Rocteur)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: searching for 1st occurrence
  5. Summary: awk, sed, ed
  6. Message-ID: <100.8886@incc.com>
  7. Date: 17 Aug 92 17:25:59 GMT
  8. References: <15m8aqINN6ci@seven-up.East.Sun.COM> <1992Aug17.001516.29088@news.acns.nwu.edu>
  9. Organization: InCC.com Perwez Belgium
  10. Lines: 27
  11.  
  12. In article <1992Aug17.001516.29088@news.acns.nwu.edu>, navarra@casbah.acns.nwu.edu (John Navarra) writes:
  13. > In article <MITCH.92Aug16153742@mira.clsi> mitch@clsi (Mitchell N. Perilstein) writes:
  14. > >
  15. > >You can just skip the grep and do it in one step:
  16. > >
  17. > >    awk '/SS2/ {print; exit}' < systems
  18. > >
  19. > or, you can just skip awk and do it in sed:
  20. >     sed -n '/123/{p;q;}' filename
  21. or, you can just skip sed and do it in ed:
  22.  
  23.     echo /123|ed filename
  24.  
  25. This is very silly and could go on for a while.
  26. -- 
  27.  __^__                                                              __^__
  28. ( ___ )------------------------------------------------------------( ___ )
  29.  | / | Jerry Rocteur                       Email: jerry@InCC.COM    | \ |
  30.  | / |             Independent Computer Consultants                 | \ |
  31.  | / | Phone +32.2.235.7045  +32.81.65.53.58    fax +32.81.65.70.20 | \ |
  32.  | / |--------------------------------------------------------------| \ |
  33.  |___|                It's beyond my control.                       |___|
  34. (_____)------------------------------------------------------------(_____)
  35.    ^                                                                  ^
  36.