Bruno Haible <[EMAIL PROTECTED]> writes: > tee appears to drop its input (i.e. it does not write it into the specified > log file) if stdout is closed. > > I didn't expect this behaviour, and POSIX > http://www.opengroup.org/susv3/utilities/tee.html > does not mandate this behaviour either. Rather, it says: > "If any file operands are specified, the standard input shall be copied to > each named file."
It also says: ASYNCHRONOUS EVENTS Default, except that if the −i option was specified, SIGINT shall be ignored. > $ rm -f empty; touch empty; rm -f output output2; \ > for a in 0 1 2 3 4 5 6 7 8 9 ; do \ > for b in 0 1 2 3 4 5 6 7 8 9 ; do \ > echo g$a$b | tee -a output; \ > echo h$a$b >> output2; \ > done; \ > sleep 2; \ > done \ > | { sleep 1; join --nocheck-order -v 2 - empty; } > > The 'join' command notices that its second argument is empty, stops reading, > and exits immediately. The tee process then receives a SIGPIPE when trying to write to the broken pipe. That will kill it. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils