From owner-freebsd-hackers@FreeBSD.ORG Tue Jun 8 09:01:41 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B02C1065673 for ; Tue, 8 Jun 2010 09:01:41 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mail.bsdforen.de (bsdforen.de [212.204.60.79]) by mx1.freebsd.org (Postfix) with ESMTP id 390F78FC1C for ; Tue, 8 Jun 2010 09:01:40 +0000 (UTC) Received: from mobileKamikaze.norad (unknown [46.114.141.201]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bsdforen.de (Postfix) with ESMTP id 82F078A1F22 for ; Tue, 8 Jun 2010 11:01:39 +0200 (CEST) Message-ID: <4C0E06F1.6030607@bsdforen.de> Date: Tue, 08 Jun 2010 11:01:37 +0200 From: Dominic Fandrey User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-GB; rv:1.9.1.9) Gecko/20100331 Thunderbird/3.0.4 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <20100605201242.C79345B52@mail.bitblocks.com> <4C0AB448.2040104@FreeBSD.org> <86r5kk6xju.fsf@ds4.des.no> <4C0C1A0B.4090409@FreeBSD.org> <86d3w3yflj.fsf@ds4.des.no> <20100607000607.97C6F5B5A@mail.bitblocks.com> <86631vksqb.fsf@ds4.des.no> <20100607155900.76080dca@Awfulhak.org> In-Reply-To: <20100607155900.76080dca@Awfulhak.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: head behaviour X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 09:01:41 -0000 On 08/06/2010 00:59, Brian Somers wrote: > On Mon, 07 Jun 2010 13:05:48 +0200, Dag-Erling Smørgrav wrote: >> Bakul Shah writes: >>> Except read doesn't do it quite right: >>> >>> $ ps | (read a; echo $a ; grep zsh) >>> PID TT STAT TIME COMMAND >> >> yeah, I forgot that it drops leading whitespace... > > Well, leading $IFS > > $ ps | (IFS= read a; echo "$a"; grep zsh) > > works a lot better. As does using sed, which is the right tool for this kind of job anyway. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?