ksh script
|
Original Message
|
Name: abby
Date: July 18, 2002 at 11:58:52 Pacific
Subject: ksh script |
Comment: Hi all, I'm trying to prompt user for input using "read" in ksh script. I want to quit, if the user doen't input any value for say "45" seconds. Can anyone help me accomplish this task? Thanks
Report Offensive Message For Removal
|
|
Response Number 2
|
Name: LANkrypt0
Date: July 18, 2002 at 15:00:24 Pacific
Subject: ksh script |
Reply: (edit)I cant figure this one out. Problem it seems is that when you issue the read command it puts the script on "hold". Ill keep thinking/working on it and post a something tomorrow (explaination as to why not if I cant get it :)
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: Frank
Date: July 19, 2002 at 00:56:11 Pacific
Subject: ksh script |
Reply: (edit)Abby, On HP-UX use "reply=`line -t 45` refer to "man line" for detail description. This is not portable to other Unix. If you are not using HP-UX please specify which kind of unix you are using. No RISK no fun Frank
Report Offensive Follow Up For Removal
|
|
Response Number 4
|
Name: Frank
Date: July 19, 2002 at 01:35:26 Pacific
Subject: ksh script |
Reply: (edit)Abby, In the menawhile i wrote the following: It is a litel bit long and uncomfortable but it past the first tests. DATE_TIMEOUT=45 FILE_PID=/tmp/`basename $0`_$$ echo $$ > $FILE_PID
kill_time () { sleep $DATE_TIMEOUT if [ -f $FILE_PID ] then kill -9 `cat $FILE_PID` rm $FILE_PID fi } kill_time& echo "\007kann den echt keiner lesen ? (y or n, default: y) \c" read testen rm $FILE_PID echo $testen No RSIK no fun
Frank
Report Offensive Follow Up For Removal
|
|
Response Number 6
|
Name: Frank
Date: July 21, 2002 at 01:53:03 Pacific
Subject: ksh script |
Reply: (edit)Steve, es ist wie es ist, und es wird wie wir es machen. :-) Kleiner philosophischer anfall. No RSIK no fun Frank
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: