*BSD News Article 74637


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!howland.reston.ans.net!vixen.cso.uiuc.edu!newsfeed.internetmci.com!news.mathworks.com!fu-berlin.de!informatik.tu-muenchen.de!lrz-muenchen.de!uni-erlangen.de!uniol!news.uni-stuttgart.de!rz.uni-karlsruhe.de!nntp.gmd.de!news.ruhr-uni-bochum.de!news.rwth-aachen.de!newsserver.rrzn.uni-hannover.de!tubsibr!malibu.ts.rz.tu-bs.de!not-for-mail
From: mb@malibu.ts.rz.tu-bs.de (Martin Butkus)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: sh command shell script writing. i'm stuck
Date: 22 Jul 1996 20:46:15 +0200
Organization: TU Braunschweig, Germany
Lines: 21
Distribution: world
Message-ID: <4t0i9n$otn@malibu.ts.rz.tu-bs.de>
References: <4t02d1$nec@cliff.island.net>
Reply-To: M.Butkus@tu-bs.de
NNTP-Posting-Host: rzrtr1.rz.tu-bs.de
X-Newsreader: TIN [version 1.2 PL2]
Originator: y0001415@ws.rz.tu-bs.de

Victor Aker (bryanm@north.island.net) wrote:

: an example, line 3 and line 3 only). So far, I have gotten this far:
: tempuser=$(ls /home | cat -n | grep -G "$counter"

:         3       ets

: where I only need

: ets

: Any script gurus out there?

No guru, but an awk lover :). An easy way would be

tempuser=$(ls /home | awk "NR==$counter")

--
Martin Butkus					>>> Live long and prosper. <<<
Phone/Fax: +49.5331.298710
Am Stadtwege 10, 38304 Wolfenbuettel, Germany	M.Butkus@tu-bs.de