On Mon, 2009-07-20 at 10:52 +0100, Charles Forsyth wrote:
> you don't really want to get "write error" printed from every
> process in a pipe line such as

As much as I thought that could be an issue, I could NOT actually
make many of the commands I tried produce this message on a 
modified 9vx:
   term% ls | date
   ....
Some did produce a message, but somehow it didn't look all that
problematic (helpful, in fact -- letting me know that somewhere
in my pipe there was a problem and not all of the data went through):
   term% awk 'BEGIN { printf("Hello\n"); }' | date
   awk: write error on stdout

>       slowly-compute-big-file | dosomemore | andyetmore | sed -n 
> '/something/;p;q'
> or even
>       slowly-compute-big-file | badusageofsomething
> where the latter prints a "usage" message and quits.
> you want to make sure the previous commands in the pipeline stop, right away.

One again -- just to make things clear -- slowly-compute-big-file WILL
NOT stop before it attempts the first actual write on a closed pipe. It
will merrily compute away. A trivial:
   cpu% sleep 1000000 | sleep 1
would be enough to verify your hypothesis. 

Thanks,
Roman.


Reply via email to