public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Relson <relson@osagesoftware.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Not head, not tail, maybe belly
Date: Wed, 22 Sep 2010 18:12:48 -0400	[thread overview]
Message-ID: <20100922181248.0b3d8ce3@osage.osagesoftware.com> (raw)
In-Reply-To: <AANLkTim6PWa_-QBAU5v0dcO0Xri1pML_kbGGJc0BfScz@mail.gmail.com>

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.elmar@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.
> >
> 
> grela@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



  parent reply	other threads:[~2010-09-22 22:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-22 14:53 [gentoo-user] Not head, not tail, maybe belly Al
2010-09-22 15:04 ` Maciej Grela
2010-09-22 15:11   ` Florian CROUZAT
2010-09-22 15:47     ` Al
2010-09-22 15:55       ` Alan McKinnon
2010-09-22 22:12   ` David Relson [this message]
2010-09-22 15:06 ` [gentoo-user] " Remy Blank
2010-09-22 15:43 ` [gentoo-user] " Paul Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100922181248.0b3d8ce3@osage.osagesoftware.com \
    --to=relson@osagesoftware.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox