timeout -s ${kill_signal} --preserve-status ${maxrun} /root/mon-lastdata.sh example: timeout -s 9 --preserve-status 100 /root/mon-lastdata.sh -s 9 is equivalent to kill -9