[SunHELP] Scripting Question,

Nicholas Dronen sunhelp at sunhelp.org
Fri Mar 23 10:04:26 CST 2001


On Thu, Mar 22, 2001 at 11:04:21AM -0500, Naser Ali wrote:
> Hello Every one,
> 
> I have a shell script which in one stage o its run sleeps for defined time
> period (which is hard coded).
> I want the script to sleep and continue after the sleep time, but if a key
> on the key board is pressed it should come out of the sleep and continue
> before it completes the sleep cycle.

#!/usr/bin/ksh

trap 'echo "caught SIGINT"' 2

echo before sleep
sleep 300
echo after sleep

$ ./foo
before sleep
^Ccaught SIGINT
after sleep



More information about the SunHELP mailing list