Or, as a script ... --- begin bin/belly --- RANGE=$1 shift sed -n ${RANGE}p $* --- end --
On Wed, 22 Sep 2010 17:04:43 +0200 Maciej Grela wrote: > 2010/9/22 Al <oss.el...@googlemail.com>: > > Hi, > > > > I am looking for a program similar to head or tail. It should > > display a given range of lines or take a line and a context number > > like grep. > > > > Any suggestions? Thanks in advance. > > > > gr...@pazuzu ~ $ cat /etc/passwd | sed -n -e '4,10 p' > adm:x:3:4:adm:/var/adm:/bin/false > lp:x:4:7:lp:/var/spool/lpd:/bin/false > sync:x:5:0:sync:/sbin:/bin/sync > shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown > halt:x:7:0:halt:/sbin:/sbin/halt > mail:x:8:12:mail:/var/spool/mail:/bin/false > news:x:9:13:news:/usr/lib/news:/bin/false > > Br, > Maciej Grela