bug-bash
[Top][All Lists]
Advanced

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

Re: Command hangs when using process substitution


From: Daniel Barrett
Subject: Re: Command hangs when using process substitution
Date: Sat, 18 Nov 2023 09:56:12 -0500

On November 18, 2023, Greg Wooledge wrote:
>On Sat, Nov 18, 2023 at 08:36:06AM -0500, dbarrett--- via Bug reports for the 
>GNU Bourne Again SHell wrote:
>> echo foo | tee >(xclip -i) | tr o x
>> 
>> The command does print "fxx" but then it hangs.
>> 
>> The same command behaves correctly when run in zsh.
> [...]
>I can confirm that the stdout of xclip is indeed attached
>to the stdin of tr, via pipe:[29847034].  Therefore, as a workaround,
>I would suggest:
>
>unicorn:~$ echo foo | tee >(xclip -i >/dev/null) | tr o x

Wow, Greg, thank you so much for taking the time to write your rapid
and super-informative reply!

If it's helpful, here's another interesting piece of the puzzle: the
"xsel -i" command (which also copies stdin to the X primary selection,
like "xclip -i" does) works fine in the original pipeline, without
needing the redirect to /dev/null:

$ echo foo | tee >(xsel -i) | tr o x
fxx

--
Dan Barrett
dbarrett@blazemonger.com




reply via email to

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