Gentoo Archives: gentoo-user

From: David Relson <relson@×××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Not head, not tail, maybe belly
Date: Wed, 22 Sep 2010 22:13:11
Message-Id: 20100922181248.0b3d8ce3@osage.osagesoftware.com
In Reply to: Re: [gentoo-user] Not head, not tail, maybe belly by Maciej Grela
1 Or, as a script ...
2
3 --- begin bin/belly ---
4 RANGE=$1
5 shift
6 sed -n ${RANGE}p $*
7 --- end --
8
9
10 On Wed, 22 Sep 2010 17:04:43 +0200
11 Maciej Grela wrote:
12
13 > 2010/9/22 Al <oss.elmar@××××××××××.com>:
14 > > Hi,
15 > >
16 > > I am looking for a program similar to head or tail. It should
17 > > display a given range of lines or take a line and a context number
18 > > like grep.
19 > >
20 > > Any suggestions? Thanks in advance.
21 > >
22 >
23 > grela@pazuzu ~ $ cat /etc/passwd | sed -n -e '4,10 p'
24 > adm:x:3:4:adm:/var/adm:/bin/false
25 > lp:x:4:7:lp:/var/spool/lpd:/bin/false
26 > sync:x:5:0:sync:/sbin:/bin/sync
27 > shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
28 > halt:x:7:0:halt:/sbin:/sbin/halt
29 > mail:x:8:12:mail:/var/spool/mail:/bin/false
30 > news:x:9:13:news:/usr/lib/news:/bin/false
31 >
32 > Br,
33 > Maciej Grela