ITbert.de

Bash timeout function

TIMEOUT=”60″
$MYPROGRAM >/dev/null &
pid=$!
sleep $TIMEOUT && kill -9 $pid >/dev/null 2>&1 && echo “$MYPROGRAM failed”

Exit mobile version