Article View: comp.unix.shell
Article #284searching for 1st occurrence
From: Laura Taylor
Date: Tue, 04 Aug 1992 15:39
Date: Tue, 04 Aug 1992 15:39
21 lines
946 bytes
946 bytes
Inside a shellscript, I would like to search for only the first occurrence of a particular string, or in otherwords, just one occurrence of the same string so I can set it to a variable. For example, say in file called systems, there is a list of all the system architectures something like... SS2 SS1 SS2 4/75 I'd like to use say grep such that when I search for SS2, it only grabs one occurrence of SS2, and does not spit out SS2 twice. Anyone got any hints? Thanks, /laura
Technical Details
Message-ID:
<15m8aqINN6ci@seven-up.East.Sun.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!decwrl!sun-barr!news2me.ebay.sun.com!seven-up.East.Sun.COM!blinky!ltaylorShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!hal.com!decwrl!sun-barr!news2me.ebay.sun.com!seven-up.East.Sun.COM!blinky!ltaylor From: ltaylor@blinky.East.Sun.COM (Laura Taylor) Newsgroups: comp.unix.shell Subject: searching for 1st occurrence Message-ID: <15m8aqINN6ci@seven-up.East.Sun.COM> Date: 4 Aug 92 15:39:06 GMT Organization: Sun Microsystems Inc, Mt. View, CA, USA Lines: 21 NNTP-Posting-Host: blinky.east.sun.com Originator: ltaylor@blinky