Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

to check if someone's command prompt available

Status
Not open for further replies.

cruel

Programmer
Aug 6, 2001
131
Hi,

I am making a script to see if some specific user has any terminal where the comand prompt is available. If yes, then execute the rest of the script. How do I do that? Thanks

p.s. If the question is not clear enough, please say so and I will try better
 
Do you mean :
a) The user is currently logged in ?
b) Their .profile allows them to drop into command line mode( rather than executing a program and then quitting?)
c) Has a screen in front of them ???
Please explain your problem again.

Dickie Bird (:)-)))
 
Thanks. This is the situation I meant by "the command prompt is available":
1)> sleep 300 &
>
This is the opposite:
2)> sleep

(the empty line above is where the cursor is).

Script will ask the user if they want to execute it now IF:
a) of course the user is logged on, b) there is one terminal has a prompt available, c) start the script pop up on that terminal only if possible.
 
Could I ask why you want to run a script on someone elses terminal session? Mike

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

It's like this; even samurai have teddy bears, and even teddy bears get drunk.
 
Could you be a little more specific about the $?prompt, what about ksh? The thought is that the script should not disturb the user if the user is in an interactive mode or edit some file and so on. Thanks
 
Thanks. The script will be used by those users. This piece is the last job among a batch process. It might take an overnight to get to the last piece. If I make the last piece a separate script, the script would have to ask users to type in all the inputs all over again. I am adding the last piece to the batch process, so I thought of letting script to check periodically if the user has a prompt available, and if yes and if the user is willing, execute the last piece.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top