Configuration Information [Automatically generated, do not change]: Machine: ia64 OS: hpux11.31 Compiler: cc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='ia64' -DCONF_OSTYPE='hpux11.31' -DCONF_MACHTYPE='ia64-hp-hpux11.31' -DCONF_VENDOR='hp' -DLOCALEDIR='/u sr/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -DHPUX -I. -I. -I./include -I./lib -O -I/usr/local/include -D_XOPEN_SOURCE_EXTENDED uname output: HP-UX van-saml B.11.31 U ia64 3018224905 unlimited-user license Machine Type: ia64-hp-hpux11.31
Bash Version: 4.2 Patch Level: 10 Release Status: release Description: I am attempting to use exec and tee to have my scripts stdout/stderr appended to a log file like such: exec > >(tee -a $LOG) 2>&1 These scripts will often call other scripts with a similar exec statement, often writing to a separate log file. On my GNU/Linux systems, these scripts will run just fine without any issue, but on HP-UX they seem to hang or not display any output. Repeat-By: $ cat test_exec1.sh #!/bin/bash LOG="test_exec.log" exec > >(/usr/bin/tee -a $LOG) 2>&1 echo "i am exec1.." ./test_exec2.sh echo "i am done in exec1.." $ cat test_exec2.sh #!/bin/bash LOG="test_exec2.log" exec > >(/usr/bin/tee -a $LOG) 2>&1 echo "i am exec2.." echo "i am done in exec2.." On one of my HP-UX hosts I can run this script many times before it hangs. $ while true; do ./test_exec1.sh; done i am exec1.. i am done in exec1.. i am exec2.. i am done in exec2.. ...snip lots of repeats... i am done in exec1.. i am exec2.. i am done in exec2.. i am exec1.. <hangs here, ctrl+c to end> $ echo $? 130 On the following host it hangs much more quickly and we don't in fact get any output from test_exec2.sh script. $ while true; do ./test_exec1.sh; done i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. i am exec1.. i am done in exec1.. <hangs here, ctrl+c to end> $ echo $? 130 Other times it just refuses to run at all: $ ./test_exec1.sh $ echo $? 141 I'd really appreciate some guidance on this issue, if you believe it is a bash bug or if in fact it's purely an issue with HP-UX or system configuration. If its helpful, I can provide tusc output for these commands. Thank you.