From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OyRg8-0002EE-96 for garchives@archives.gentoo.org; Wed, 22 Sep 2010 15:56:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B32EBE0BFF; Wed, 22 Sep 2010 15:55:35 +0000 (UTC) Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com [209.85.215.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 74E33E0BFF for ; Wed, 22 Sep 2010 15:55:35 +0000 (UTC) Received: by ewy3 with SMTP id 3so234906ewy.40 for ; Wed, 22 Sep 2010 08:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=V/o5xBzgmyHYKscGw+1/oNIOfwSG9jZVkMrYyPkEGgQ=; b=yFbn0e0iCyUaf8aDAd0Zr6ATzPx9PyqcNShwk2tx9IT8cP/DqQiFkGzoebHI+/g85S suJvXyNwy6bAI5h/hgs3WlSdW3BatVv7g51BCHrTUFxP1jNpXJLr55sU44S/i01K7W2q pokjGwIxbGh01CvmI9epTTBBrEOi1AW27yIr0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:message-id; b=AmSGboB0fTerjIr4bu6ku7uCB4TJd8qQp9aSw5E16ueuKCSbjv//WtDP6LJ9IWa2rV VGg208IkL1btNjWSBSB5UqJJ+eS+NoGwY4KdTBDXVy+DkhfeXcxmlSrgI7xMJvPcPbm/ HJujJXO0DkRcjQxIdvnUgItws0+77DPiqv5rs= Received: by 10.213.114.17 with SMTP id c17mr5433007ebq.62.1285170934578; Wed, 22 Sep 2010 08:55:34 -0700 (PDT) Received: from nazgul.localnet (dustpuppy.is.co.za [196.14.169.11]) by mx.google.com with ESMTPS id u9sm14946446eeh.5.2010.09.22.08.55.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 22 Sep 2010 08:55:33 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Not head, not tail, maybe belly Date: Wed, 22 Sep 2010 17:55:25 +0200 User-Agent: KMail/1.13.5 (Linux/2.6.35-ck-r2; KDE/4.5.1; x86_64; ; ) References: <6D141799-2F75-4C0A-961B-140850A5B29D@floriancrouzat.net> In-Reply-To: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201009221755.26061.alan.mckinnon@gmail.com> X-Archives-Salt: bca8da21-3f3a-415a-9474-e26ab1398955 X-Archives-Hash: 982a401615b17f3702f5f2be1260ebae Apparently, though unproven, at 17:47 on Wednesday 22 September 2010, Al did opine thusly: > >> grela@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 considered while > the general approach (range), that would cover all, is missing. Is > that rather for performance or for historical reasons? > > Al Neither. It's because one frequently wants to see the start or end of a file and much less seldom something in the middle. When that is what you want, there are all manner of other tools to find the bit you want, then display surrounding text. grep -{ABC} is the usual tool for that -- alan dot mckinnon at gmail dot com