*BSD News Article 74444


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!nntp.coast.net!chi-news.cic.net!newsfeeder.sdsu.edu!newspump.sol.net!news.inc.net!news.moneng.mei.com!uwm.edu!math.ohio-state.edu!howland.reston.ans.net!newsfeed.internetmci.com!newsreader.sprintlink.net!news.sprintlink.net!news-pen-4.sprintlink.net!news.mathworks.com!nntp.primenet.com!uunet!inXS.uu.net!news.island.net!island
From: bryanm@north.island.net (Victor Aker)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: sh command shell script writing. i'm stuck
Date: Mon, 22 Jul 96 14:19:40 GMT
Organization: Island Internet Inc. - (604) 753-2383
Lines: 22
Message-ID: <4t02d1$nec@cliff.island.net>
NNTP-Posting-Host: slip16.north.island.net
X-Newsreader: News Xpress 2.0 Beta #0
Keyword: sh grep cat

I am trying to import text one line at a time into a shell script that I am 
writing, and having a real bugger of a time. I need to grab these lines one by 
one, and explicitly state each time which line number it is (Only grabbing, as 
an example, line 3 and line 3 only). So far, I have gotten this far:

tempuser=$(ls /home | cat -n | grep -G "$counter"

where counter is the number of the line. One problem, this output is giving me 
the following:

        3       ets

where I only need

ets



Any script gurus out there?

Victor.