On 08/06/2010 00:59, Brian Somers wrote:
> On Mon, 07 Jun 2010 13:05:48 +0200, Dag-Erling Smørgrav <d...@des.no> wrote:
>> Bakul Shah <ba...@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? 
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to