coreutils
[Top][All Lists]
Advanced

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

Enhancement request for tee - please add the option to not quit on SIGPI


From: Jirka Hladky
Subject: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened
Date: Wed, 18 Nov 2015 23:50:14 +0100

Hello tee developers,

I have recently run into an issue that tee will finish as soon as first pipe it's writing to is closed. Please consider this example:

$cat /dev/zero | tee >(head -c1 | wc -c )  >(head -c100M | wc -c ) >/dev/null 
1
65536

Second wc command will receive only 64kB instead of expected 100MB. 

IMHO, tee should have a command line option to proceed as long some file is opened. It should be accompanied by another switch which will suppress writing to STDOUT.

 cat /dev/zero | mytee --skip_stdout_output --continue_on_sigpipe >(head -c1 | wc -c ) >(head -c100M | wc -c )

Expected output:
1
104857600

I can implement the changes myself. Please let me know your opinion on that. BTW, I'm not the first one looking for this feature:

http://stackoverflow.com/questions/15265228/pipe-to-multiple-files-but-not-stdout
http://unix.stackexchange.com/questions/10623/a-tee-process-is-truncating-its-stdout-when-writing-a-file

Thanks
Jirka

reply via email to

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