[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #19337] Whish: Include Option to view first line of file/stream
From: |
Bob Proulx |
Subject: |
[bug #19337] Whish: Include Option to view first line of file/stream |
Date: |
Fri, 14 Mar 2008 06:53:07 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.8.1.12) Gecko/20080129 Iceweasel/2.0.0.12 (Debian-2.0.0.12-0etch1) |
Follow-up Comment #4, bug #19337 (project grep):
> ps aux | head -1; ps aux | grep foo
Another way to provide this is to include a grep pattern that will match the
first line. Example:
ps aux | grep -e ^USER -e foo
> ps aux | (head -1; grep foo)
> but that didn't work consistently for me across all systems I
> work on. I suspect it only works with the most recent versions
> of coreutils. (If someone knows why, please add to the
> discussion.)
That is almost certainly due to head using libc's stdio library which on
different systems is buffering input. After head has read it the data is no
longer available for grep to read.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?19337>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/