|
Hello Bob. I wasn't clear enough. My goal was to do different things on the first lines and the last lines of same input, without using storage, thus using piped processes. Then I used tee, to fork the pipe into two processes. In my post before, I wanted to show three ways that work, including (head; cat) that does exactly the same as what would do head with the option I suggested in my initial post. Opposite to that, my original way that fails : rm /tmp/fifo1 mkfifo /tmp/fifo1 cat /tmp/fifo1|head -n2|sed 's/^/head &/' & tee /tmp/fifo1|tail -n2|sed 's/^/tail &/'That way, the /tmp/fifo1 fifo propagates SIGPIPE ahead to tee as soon as head has finished, then tee stops, and tail doesn't read the expected last lines, instead just the lines before tee aborts and EOF is read on pipe. The effect is observable on large input, like /usr/share/mysql/errmsg-utf8.txt Also tried tee -i to ignore interrupts, but it is not the purpose of this option I suppose. No effect in our case.
Thibault Le Paul Directeur Technique [email protected]
10, Lotissement EL OMRANIA On 16/10/2012 04:20, Bob Proulx wrote: Hello Thibault,Please keep the mailing list in the CC list so that everyone can participate and learn from the discussion. Thanks. Thibault LE PAUL wrote: |
- [head] wished an option to continue consuming the input a... Thibault LE PAUL
- Re: [head] wished an option to continue consuming th... Bob Proulx
- Re: [head] wished an option to continue consumin... Bob Proulx
- Re: [head] wished an option to continue cons... Thibault LE PAUL
- Re: [head] wished an option to continue ... Bob Proulx
- Re: [head] wished an option to cont... Thibault LE PAUL
- Re: [head] wished an option to ... Thibault LE PAUL
- Re: [head] wished an option... Bob Proulx
- Re: [head] wished an option to continue ... Pádraig Brady
