Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!uunet!tellab5!vpnet!dattier From: dattier@vpnet.chi.il.us (David W. Tamkin) Newsgroups: comp.unix.questions Subject: Re: need help on unix Message-ID: <1991Jun18.153828.15839@vpnet.chi.il.us> Date: 18 Jun 91 15:38:28 GMT References: <1991Jun11.004109.21966@unixg.ubc.ca> <8382@auspex.auspex.com> Distribution: na Organization: VPnet Public Access Unix, Villa Park, Illinois 60181-2206 Lines: 25 guy@auspex.auspex.com (Guy Harris) wrote in <8382@auspex.auspex.com>: | "sed" can do a better job; if you want to remove the first N lines, try | "sed -n 'N-1,$p'", where "N-5" needs to be computed and literally | inserted in the command. If you want to remove the first N lines, you don't need to calculate N-1 nor N-5. You could calculate N+1 and write sed -n 'N+1,$p' or calculate nothing at all, do less typing, and write sed '1,Nd' # assuming N is an integer written in digits Depending on your shell, if N is in a variable, you can use something like (in sh or ksh) sed "1,$N d" David Tamkin PO Box 7002 Des Plaines IL 60018-7002 dattier@vpnet.chi.il.us GEnie:D.W.TAMKIN CIS:73720,1570 MCIMail:426-1818 708 518 6769 312 693 0591 "Parker Lewis Can't Lose" mailing list: flamingo-request@esd.sgi.com (reflector) flamingo-request@mcs.com (digest)