MY_ID=$$ COUNT=`ps -ejHf | tee /tmp/tmp.out | grep "$0" | grep -v "grep" | grep -v " ${MY_ID} " | wc -l` if [ ${COUNT} -ne 0 ]; then echo "--------- PID = ${MY_ID}" >> /tmp/ZZZ.out; cat /tmp/tmp.out >> /tmp/ZZZ.out; fi