bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sort feature requests


From: Matthew Woehlke
Subject: Re: sort feature requests
Date: Mon, 30 Jul 2007 16:21:30 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070509 Thunderbird/1.5.0.12 Mnenhy/0.7.4.0

Jim Meyering wrote:
Matthew Woehlke <address@hidden> 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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]