Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 2010 11:01:37 +0200
From:      Dominic Fandrey <kamikaze@bsdforen.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: head behaviour
Message-ID:  <4C0E06F1.6030607@bsdforen.de>
In-Reply-To: <20100607155900.76080dca@Awfulhak.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>

next in thread | previous in thread | raw e-mail | index | archive | help
On 08/06/2010 00:59, Brian Somers wrote:
> On Mon, 07 Jun 2010 13:05:48 +0200, Dag-Erling Smørgrav <des@des.no> wrote:
>> Bakul Shah <bakul@bitblocks.com> 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? 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C0E06F1.6030607>