Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

process substitution in bash, sometimes I have to press "Enter"

Tags:

linux

bash

I'm just learning to use process substitution in bash. Here's the command:

echo TEXT > >(tee log)

This is a pointless command but the thing is I have to press Enter after I run it. Why is that?

Sometimes this happens with more useful commands like:

ls SOME_NON_EXISTING_FILE 2> >(tee log)
like image 407
Serg Avatar asked Nov 28 '25 17:11

Serg


1 Answers

Actually Enter is not really needed, you can just enter next command e.g. date and check. What is happening that because of process substitution your command exits first and then output gets written on your terminal, that is the reason you get false impression of need to press an Enter.

like image 197
anubhava Avatar answered Dec 01 '25 06:12

anubhava