Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/15/85; site sci.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!amdcad!cae780!weitek!sci!raymund From: raymund@sci.UUCP (Raymund Galvin) Newsgroups: net.sources.bugs Subject: Re: YASS (yet another shell script) Message-ID: <153@sci.UUCP> Date: Sat, 15-Mar-86 15:51:01 EST Article-I.D.: sci.153 Posted: Sat Mar 15 15:51:01 1986 Date-Received: Mon, 17-Mar-86 03:45:23 EST References: <620@ssc-vax.UUCP> Distribution: net Organization: Silicon Compilers, Inc., San Jose, CA Lines: 20 Summary: it can be done with an csh alias In article <620@ssc-vax.UUCP>, aims@ssc-vax.UUCP (John Daley) writes: > This is a 'simple' little shell script I whipped up, out of need, to > print a specific line of a specific file. Yes, I chose to use the B > shell, but it gets the job done, right?. > > Why am I posting such a meager little script? This newsgroup hasn't > been very active lately (excluding discussions). Anybody out there > got a better way to do what my script does? ^^^^^^ Better? I dont know. I dont have access to B shell. The following alias will print any single line from a text file: alias line 'awk NR==\!:1 \!:2-$' Example: "line 10 .login" would print the tenth line from .login The following alias will print a range of lines from a text file: alias list 'awk NR==\!:1,NR==\!:2\{print\ NR\":\"\$0\} \!:3-$' Example: "list 9 11 .login" would print lines 9 - 11 from .login