I have a ksh script running on AIX 5.3 which has sometimes a bizarre behaviour.
The script runs a child script like follow.
trap 'rm -f /tmp/res.log;exit 0' 2 15
run_child.sh > /tmp/res.log 2>&1
echo "run_child.sh is terminated"
next instructions...
rm -f /tmp/res.log
sometimes, the echo and next instructions are never proceeded.
if you set -x the script, you can see the last instruction is
+ run_child.sh > /tmp/res.log 2>&1
if you trace run_child.sh, you can see that it seems to go fine as i put an echo just before his last instruction (exit 0), and that i can see the result of the echo in the log.
So I'm searching here because i don't know what happen really.
This is not systematic but arrives sometimes (10% of executions)
Parent script is run with HP Operation Manager with root user and a process named opcle
Child script is collecting information in a Oracle database and then ends with an output file.