[gentoo-user] Not head, not tail, maybe belly

2010-09-22 Thread Al
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. Al

Re: [gentoo-user] Not head, not tail, maybe belly

2010-09-22 Thread Florian CROUZAT
On 22 sept. 2010, at 17:04, 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 ~

Re: [gentoo-user] Not head, not tail, maybe belly

2010-09-22 Thread Paul Hartman
On Wed, Sep 22, 2010 at 9:53 AM, Al oss.el...@googlemail.com wrote: 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. sed -n 5,8p filename where 5 is first line

Re: [gentoo-user] Not head, not tail, maybe belly

2010-09-22 Thread Al
gr...@pazuzu ~ $ cat /etc/passwd | sed -n -e '4,10 p' Best solution so far, but useless use of cat, and the subshell overhead of the pipe. Thank you. Nice solutions and they reveal that there is no belly like program in coreutils. I find it interesting, that the two bordercases are

Re: [gentoo-user] Not head, not tail, maybe belly

2010-09-22 Thread Alan McKinnon
Apparently, though unproven, at 17:47 on Wednesday 22 September 2010, Al did opine thusly: gr...@pazuzu ~ $ cat /etc/passwd | sed -n -e '4,10 p' Best solution so far, but useless use of cat, and the subshell overhead of the pipe. Thank you. Nice solutions and they reveal that there

Re: [gentoo-user] Not head, not tail, maybe belly

2010-09-22 Thread David Relson
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