bug-coreutils
[Top][All Lists]
Advanced

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

Re: cat - -


From: Mike Frysinger
Subject: Re: cat - -
Date: Tue, 15 Jan 2008 18:42:34 -0500
User-agent: KMail/1.9.7

On Tuesday 15 January 2008, address@hidden wrote:
> > what were you expecting to happen ? it is not possible for cat to
> > re-read stdin once it has consumed it.
>
> Yes, but you don't document it I bet. At least not in the path that
> starts with man cat.
>
> Just reading the coreutils docs, one wouldn't know why
> $ date|cat q b - c q - q - b
> worked except stdin only showed up once...
> Hmmm maybe also some pipes would also...

this isnt a cat/coreutils/stdin specific issue.  *any* program that consumes a 
read-destructive source would have the same "problem".  at the basic level, 
cat is functioning correctly: you told it to read from stdin as much as it 
could and that is exactly what cat did.  the fact that stdin was empty after 
the first time means you got no output the second+ time around.  you could 
make the same argument that if you wrote to a fifo and tried to cat it 
multiple times, cat was "misbehaving".
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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