File bash_output_helper.bash of Package nodejs16
xxxxxxxxxx
1
#
2
# Node can break stdin/stdout/stderr by setting them O_NONBLOCK
3
# and then not resetting it back to blocking mode on exit
4
# This function redirects stdio descriptors via new logging pipe
5
#
6
7
8
function decoupled_cmd
9
{
10
mkfifo _log
11
($@) < /dev/null > _log 2>_log &
12
cat _log
13
rm _log
14
wait $!
15
}
16
17