Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-23 Thread Pádraig Brady
On 23/11/15 10:06, Jirka Hladky wrote: > Hi all, > > I would like to have the example of process redirection similar to this one > > tee -p (head -c1 | wc -c ) > >(head -c10M | wc -c) > > in the tee's manual page. What do you think about it and what is the process > to request it? There are

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-23 Thread Jirka Hladky
Hi all, I would like to have the example of process redirection similar to this one tee -p (head -c1 | wc -c ) > >(head -c10M | wc -c) in the tee's manual page. What do you think about it and what is the process to request it? Thanks a lot Jirka On Sun, Nov 22, 2015 at 9:34 PM, Pádraig Brady

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-22 Thread Jirka Hladky
Hello everybody, any feedback to update tee's man page with example of process redirection? I think it would be really helpfull for others to have it documented. Thanks Jirka On Sat, Nov 21, 2015 at 12:58 AM, Jirka Hladky wrote: > Yes, *this is* the solution I was looking

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-22 Thread Pádraig Brady
On 22/11/15 20:13, Bob Proulx wrote: > Pádraig Brady wrote: >> +If you want to further process the output from process substitutions, >> +and those processes write atomically (i.e. write less than the system's >> +PIPE_BUF size at a time), that's possible with a construct like: > > When I read

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Jirka Hladky
Hi, thanks for the script, it definitely provides more control than the plain tee command. I have done some modifications so that progress can be watched live I have tried two versions of the main command (one with >/dev/full, other one with >&-). cat /dev/zero | head -c500M |

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Pádraig Brady
On 20/11/15 02:20, Pádraig Brady wrote: > I'm coming around to making a change here. > > Either be quiet about: > datagen | tee >(sha1sum --tag) >(md5sum --tag) >&- | sort | gpg --clearsign > > Or support: > datagen | tee --no-stdout >(sha1sum --tag) >(md5sum --tag) | sort | gpg >

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Pádraig Brady
On 20/11/15 04:33, Assaf Gordon wrote: > Hello Jirka, > > Regarding this: > > On 11/19/2015 08:58 PM, Jirka Hladky wrote: >>> The general problem I have with >(process substitutions) are that >>> they are completely asynchronous. There is no way to tell if they >>> are done. >> >> Yes, I agree

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Bernhard Voelker
On 11/20/2015 01:08 PM, Pádraig Brady wrote: > + tee no longer diagnoses write errors to a closed standard output, as this > + can be useful when further piping the output from process substitutions. I'm not sure this is allowed by POSIX, but at least this regresses for other reasons of EBADF

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Jim Meyering
On Fri, Nov 20, 2015 at 1:08 PM, Pádraig Brady wrote: > On 20/11/15 02:20, Pádraig Brady wrote: >> I'm coming around to making a change here. >> >> Either be quiet about: >> datagen | tee >(sha1sum --tag) >(md5sum --tag) >&- | sort | gpg --clearsign >> >> Or support: >>

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Bernhard Voelker
On 11/20/2015 03:35 PM, Jirka Hladky wrote: > I have tried two versions of the main command (one with >/dev/full, other one > with >&-). > > cat /dev/zero | head -c500M | (/dev/shm/AAA/coreutils-8.24/src/tee -p > $d/fifo1 $d/fifo2 $d/fifo3 $d/fifo4 >/dev/full ) > 2>&1 | tee $d/run.log & > and

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Eric Blake
On 11/20/2015 10:38 AM, Bernhard Voelker wrote: > On 11/20/2015 01:08 PM, Pádraig Brady wrote: >> + tee no longer diagnoses write errors to a closed standard output, as this >> + can be useful when further piping the output from process substitutions. > > I'm not sure this is allowed by POSIX,

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Pádraig Brady
On 20/11/15 17:38, Jim Meyering wrote: > On Fri, Nov 20, 2015 at 1:08 PM, Pádraig Brady wrote: >> On 20/11/15 02:20, Pádraig Brady wrote: >>> I'm coming around to making a change here. >>> >>> Either be quiet about: >>> datagen | tee >(sha1sum --tag) >(md5sum --tag) >&- |

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Jirka Hladky
> > > Doesn't this suppress a diagnostic that is likely to be valuable to > anyone who > > accidentally runs an affected tool from a context with closed standard > output? > Yes it's not ideal. > Also it doesn't map directly to closed stdout. > If we were to support it then --no-stdout would

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Jirka Hladky
Yes, *this is* the solution I was looking for! tee -p (head -c1 | wc -c ) > >(head -c10M | wc -c) Thanks to everybody to take part in the discussion and finally coming up with the solution. Could we please add this example to tee's manual page into the EXAMPLE section? If there is anything I

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Bob Proulx
Bernhard Voelker wrote: > I'm not convinced that a new --no-stdout option is warranted: > why not simply redirect stdout to the last fifo? > > cat /dev/zero | head -c500M \ > | (/dev/shm/AAA/coreutils-8.24/src/tee -p \ > $d/fifo1 $d/fifo2 $d/fifo3 > $d/fifo4 ) 2>&1 \ > | > tee

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-20 Thread Pádraig Brady
On 20/11/15 23:58, Jirka Hladky wrote: >> On Sat, Nov 21, 2015 at 12:01 AM, Bob Proulx > > wrote: >> >> Bernhard Voelker wrote: >> > I'm not convinced that a new --no-stdout option is warranted: >> > why not simply redirect stdout to the last

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-19 Thread Bob Proulx
Pádraig Brady wrote: > Jirka Hladky wrote: > > => it's almost there expect that it runs forever because of >/dev/null I am going to suggest this without trying it, always dangerous, but I have no time for a deep investment. Sorry. What about closing stdout? Then it would be closed right from

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-19 Thread Jirka Hladky
> > I am going to suggest this without trying it, always dangerous, but I > have no time for a deep investment. Sorry. What about closing > stdout? Then it would be closed right from the start. > 1>&- > Except that the no-exit behavior is only on pipes. So I guess it > would need to have a

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-19 Thread Jirka Hladky
> > If you ignore SIGPIPE in tee in the above then what will terminate the > tee process? Since the input is not ever terminated. That's why I would like to have the option to suppress writing to STDOUT. By default, tee will finish as soon as all files are closed. So without need to have

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-19 Thread Pádraig Brady
On 19/11/15 23:09, Jirka Hladky wrote: > If you ignore SIGPIPE in tee in the above then what will terminate the > > tee process? Since the input is not ever terminated. > > > That's why I would like to have the option to suppress writing to STDOUT. By > default, tee will finish as

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-18 Thread Bob Proulx
Pádraig Brady wrote: > Already done in the previous v8.24 release: Bob Proulx wrote: > If you ignore SIGPIPE in tee in the above then what will terminate the > tee process? Since the input is not ever terminated.

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-18 Thread Pádraig Brady
On 18/11/15 22:50, Jirka Hladky wrote: > 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 >

Re: Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-18 Thread Bob Proulx
Jirka Hladky wrote: > 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

Enhancement request for tee - please add the option to not quit on SIGPIPE when someother files are still opened

2015-11-18 Thread Jirka Hladky
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