1834050 Members
2143 Online
110063 Solutions
New Discussion

No Response From User

 
Gavin Powell
New Member

No Response From User

I'm trying to write a script that will kill or break from a process when there has been no response from the user within a specified amount of time.
I'm using the variable SECONDS to measure the time in a background process, and using the UNTIL command to loop until a Y or an N is entered, or No Response from the user.
The Y and N part is working Ok, but I can't get my No Response command to work, it just keeps on looping.

Any suggestions would help.

Gavin (Novice)

6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: No Response From User

Hve you explored using the TMOUT variable? Setting TMOUT to a non-zero value should do what you want.
If it ain't broke, I can fix that.
Dave La Mar
Honored Contributor

Re: No Response From User

I'll assume you are using "read" and some variable for the answer.
If so, after the specified number of seconds expire check the variable value and break if it is not a value you are seeking.

A post of that portion of your script would be helpful.

Best of luck.

dl
"I'm not dumb. I just have a command of thoroughly useless information."
Sajid_1
Honored Contributor

Re: No Response From User

hello,

the best way is to use the TMOUT value. You can set this value in the user profile too.

TMOUT=seconds;export TMOUT
# man ksh
learn unix ..
Steve Labar
Valued Contributor

Re: No Response From User

If you are using csh, it uses a local variable autologout and is set in the .cshrc

set autologout=n where n=time in seconds.

Good Luck.

Steve
Mark Greene_1
Honored Contributor

Re: No Response From User

In addition to TMOUT, verify that the tc/ip keepalive kernel parameters are set to thresholds you need; however, keep in mind that this will affect socket connections as well as telnet connections.

HTH
Mark
the future will be a lot like now, only later
Wodisch_1
Honored Contributor

Re: No Response From User

Hi Gavin,

check out the "idled" (idle daemon) - maybe it does just what you need?
Get it from the HP-UX porting archives...

HTH,
Wodisch