Hi Jim, Eric, shell utilities experts,

Sam reports that this line of code

  inmodules=`echo "$handledmodules" | LC_ALL=C join -v 2 - 
"$tmp"/queued-modules`

can print "gnulib-tool: line 1512: echo: write error: Broken pipe" on stderr.

1) The 'join' command (or 'join --nocheck-order' in coreutils 6.11 or newer)
   apparently closes its standard input and exits when the contents of the
   second file (small enough or even empty) allows to determine the complete
   'join' output - without having read all of its standard input.

2) The kernel then transforms the pipe into a pipe with no readers.

3) The 'echo' command, when writing to a pipe with no readers, gets a SIGPIPE.

4) The 'echo' command or its parent shell prints an error message on stderr.

Are these 4 behaviours all correct (POSIX compliant and to be expected)?
If not, which one is incorrect/buggy?

Bruno



Reply via email to