Jim Meyering wrote:
Matthew Woehlke <[EMAIL PROTECTED]> wrote:
This should already be possible with a command such as:
$ ( sed 1q ; sort [args] ) < [file]
...however it seems my version of sed (4.1.2-RH4) does not honor POSIX
semantics and consumes too much of the input ('head' from
coreutils-6.9 seems to have the same problem?) I did get 'read 4 ;
echo $a' to work however.
(Ok gnulib folks, I don't have any dates handy, is the fseek stuff
newer than coreutils-6.9?)
Using head works for me, both with coreutils-5.97
and the very latest 6.9+:
$ (echo 5; seq 3) > k; (head -1; sort -n) < k
5
1
2
3
If you're reporting a bug, please be specific.
Maybe I am being brain-dead... This does not work with 6.9:
$ seq 5 | ( head -1 ; sort -n )
...but now I forget if pipes are seekable (I want to say "no" actually),
so maybe PEBKAC?
Works fine if the input is a file.
--
Matthew
"...anyway, that's my 0.02 toasters"
(with apologies to Niel)
_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils