Can any shell script wizards out there tell me if there is a way using 'sh' or 'ksh' to enclose a block of script in some kind of structure that will try to execute something, wait for a predetermined amount of time, and then if there is no user input on the keyboard for that period of time, execute another block of code or else just skip what was going on entirely?
Can any shell script wizards out there tell me if there is a way usin 'sh' or 'ksh' to enclose a block of script in some kind of structure that will try to execute something, wait for a predetermined amount of time, a then if there is no user input on the keyboard for that period of time, execute another block of code or else just skip what was going on entirel
I'm not sure exactly what you're asking for... a prompted input with a timeo
After a little bit of research somebody on a DOC BBS that I'm a member of ended up mentioning that bash's 'read -t' function might be able to do what I'm looking for; it dies and returns failure after the specified
number of seconds if there has been no keyboard input. I was hoping to be able to stick with the native 'sh' or 'ksh' shells, but if I have to call bash for a small segment of the shell script it might still not be such a bad alternative.
Sysop: | Eric Oulashin |
---|---|
Location: | Beaverton, Oregon, USA |
Users: | 106 |
Nodes: | 16 (0 / 16) |
Uptime: | 10:45:43 |
Calls: | 5,846 |
Files: | 8,496 |
D/L today: |
12 files (7,044K bytes) |
Messages: | 343,180 |