Child background process in bash script errorly killed - ID: 3076954
By gnach... on October 04, 2010 18:39 (imported from Google Code)
From iTerm bug tracker https://sourceforge.net/tracker/?func=detail&aid=3076954&group_id=67789&atid=518973
--
If a bash script is run by means of 'Open With iTerm', its child background process will be killed when the script is done.
Same operation OK for 'Open With Terminal'.
system: MacBook Pro running OSX 10.4.11
iTerm 0.10, iTerm 0.9.6.20090923
To reproduce the symptom:
-
edit a bash script that will start a child background process
#!/bin/bash
echo Starting Thunderbird!
/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin &
tb_id=$!
echo "Is TB alive?"
ps -p $tb_id
sleep 15
echo "check again"
ps -p $tb_id
echo Finishing Thunderbird!
###-------------------------------------------- -
save it as "checkBG.command'
-
select it and click right button, choose "open with", then " iTerm"
-
The child background process (in this case, thunderbird ) will, unsupposedly, terminate when the script is done.
-
Now try again with 'open with'->'Terminal', the child BG process is alive when the script is done.
-
If running the script in command line, by typing ./checkBG.command in iTerm, it's OK.