Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!clyde.concordia.ca!thunder.mcrcim.mcgill.edu!mcgill-vision!snorkelwacker.mit.edu!bu.edu!rpi!zaphod.mps.ohio-state.edu!samsung!infinet!sena From: sena@infinet.UUCP (Fred Sena) Newsgroups: comp.unix.questions Subject: Re: How read a line of a file from C-shell? Message-ID: <2641@infinet.UUCP> Date: 13 Nov 90 16:30:47 GMT References: <8900@ncar.ucar.edu> <4339@aix.aix.kingston.ibm.com> <1990Oct31.232525.7990@diku.dk> Reply-To: sena@infinet.UUCP (Fred Sena) Organization: Memotec Datacom, Inc. North Andover, MA Lines: 29 In article <1990Oct31.232525.7990@diku.dk> kimcm@diku.dk (Kim Christian Madsen) writes: I haven't been on the net for a while, so I'm sorry if this response seems untimely. The cleanest way that I have found to get a line of a file is: set line=`sed -n $n'p' $file` Where $n is the line number, and $file is the file. There can be a problem if the line contains *'s though. Not because of sed, but because of the way that the csh sets the line variable. You can't store a '*' in a csh variable because it wants to turn it into file names. (Correction, I have yet to find a way) good luck. --fred -------------------------------------------------- Frederick J. Sena sena@infinet.UUCP Memotec Datacom, Inc. N. Andover, MA -- -------------------------------------------------- Frederick J. Sena sena@infinet.UUCP Memotec Datacom, Inc. N. Andover, MA