Matthew Woehlke <mw_triad <at> users.sourceforge.net> writes: > 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?
Pipes are not seekable, hence the name ESPIPE for the error that lseek sets on nonseekable files. POSIX is clear that trying to share input pipes across multiple processes has undefined behavior (about the only exception is when there is an additional explicit requirement, such as the one on sh, to read stdin unbuffered so that it never consumes too much input even when stdin is a pipe). > > Works fine if the input is a file. > Good. But note that coreutils 6.9 (Mar 22) predates the gnulib fflush/fseek changes (first started in Apr). -- Eric Blake _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
