> On 20 Oct 2019, at 19.33, Bernhard Voelker <m...@bernhard-voelker.de> wrote:
> 
> On 2018-11-25 17:45, furrymc...@lippydanger.jumpingcrab.com wrote:
>> Please consider a self join from stdin in coreutils.
>> 
>> $ seq 3 | join -j2 - - | paste -s
>> 1 1   1 2     1 3     2 1     2 2     2 3     3 1     3 2     3 3
> 
> What about tee'ing into a 'fifo' which is read again by join?
> 
> $ mkfifo fifo \
>     && seq 3 | tee fifo | join -j2 - fifo | paste -s \
>     && rm fifo
> 1 1    1 2     1 3     2 1     2 2     2 3     3 1     3 2     3 3
> 
> Have a nice day,
> Berny
> 

This will hang if the lines get so long that the fifo is filled before it can 
be emptied, e.g. this hangs on my machine:

mkfifo fifo && seq -s , 20000 | tee fifo | join -j2 - fifo | paste -s && rm fifo

Best,

Rasmus


Reply via email to