[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for a command...



Hi Ken,

We've used a simple shell script(call it "wrapper.ksh") in the past for just the sort of thing that you describe . 

Something to this effect "should work" ... :-) 

(wrapper.ksh contents)
#!/usr/bin/ksh

/export/home/rhill/scripts/cmd1.sh &
cmd1pid=`ps -ef | grep -v grep|grep cmd1|cut -d" " -f7`
sleep 60
kill -9 $cmd1pid
echo "PID $cmd1pid killed"

exit 0

HTH 

Roger Hill
============================================================
From: Ken Keefe <kaje@digitalfamily.org>
Date: 2005/03/30 Wed PM 05:04:24 CST
To: discuss@silug.org
Subject: Looking for a command...

I am hoping there is some command out there that is basically an alarm
wrapper. I'd like to be able to execute a command and if it doesn't
terminate after say 60 seconds, it is killed. I could write a C program
that could do this, but I am hoping one of you know of a magic command
that already exists.

Thanks,
Ken

-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.
============================================================



-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.