thelma_vance has asked for the wisdom of the Perl Monks concerning the following question:

Problem:

Step 1: rlogin to a remote server.
Step 2: enter the command "ksu - qrq" where qrq is not a supper user just a diffent user.

The script hangs because the script has lost focus.

Desired: After the "ksy - qrq" is executed then the the script executes "cd /cm/deliver/build; ls" returned information is a list of files.

Question: How should the script get focus after the "ksu - qrq" command.

Note: The server is a red hat 9 linux intell box.

Thanks in advance
Thelma

  • Comment on problem losing focus in terminal running rlogin

Replies are listed 'Best First'.
Re: problem losing focus in terminal running rlogin
by Fletch (Bishop) on Apr 06, 2004 at 16:44 UTC

    You want sudo, not a GUI su front end (presuming ksu is a KDE su thing). You can set it up so that it won't prompt for a password (or just setup ssh and allow whatever user you're coming from to run a script which returns the ls).

    Not that it has anything to do with perl . . .

Re: problem losing focus in terminal running rlogin
by matija (Priest) on Apr 06, 2004 at 18:43 UTC
    As Fletch has said, you need to use sudo instead of ksu to get it to prompt you in the same window. I'd just like to add that for that kind of conversation with remote servers, it would be appropriate if you used Expect - it has ways for you to match patters sent by the other server (like prompts) and send appropriate responses.
Re: problem losing focus in terminal running rlogin
by Anonymous Monk on Apr 06, 2004 at 16:39 UTC
    If your script is losing focus, you need to buy your script some glasses.