Stdout race condition between script and subscript
问题 I'm trying to call a script deepScript and process its output within another script shallowScript ; it looks schematically like the following pieces of code: shallowScript.sh #!/bin/zsh exec 1> >( tr "[a-z]" "[A-Z]" ) print "Hello - this is shallowScript" . ./deepScript.sh deepScript.sh #!/bin/zsh print "Hello - this is deepScript" Now, when I run ./shallowScript.sh , the outcome is erratic : either it works as expected (very rarely), or it prints an empty line followed by the two expected