coreutils
[Top][All Lists]
Advanced

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

Re: feature request: self join from stdin


From: Rasmus Borup Hansen
Subject: Re: feature request: self join from stdin
Date: Mon, 21 Oct 2019 08:28:12 +0200

> On 20 Oct 2019, at 19.33, Bernhard Voelker <address@hidden> wrote:
> 
> On 2018-11-25 17:45, address@hidden 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

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