#!/usr/bin/sh
( sleep 5 ; echo Warning $0 hanging - aborted ; kill -9 $$ ) &
TIMEOUT_PID=$!
Your_Line1 ...
Your_Line2 ...
Your_Line3 ...
Your_Line4 ...
Your_Line5 ...
# kill supervision sub-process
kill -9 $TIMEOUT_PID
( sleep 5 ; echo Warning $0 hanging - aborted ; kill -9 $$ ) &
TIMEOUT_PID=$!
Your_Line1 ...
Your_Line2 ...
Your_Line3 ...
Your_Line4 ...
Your_Line5 ...
# kill supervision sub-process
kill -9 $TIMEOUT_PID
No comments :
Post a Comment