-   Linux - General (
-   -   telnet script (

tn1681 07-24-2002 10:11 AM

telnet script
I have built a telnet script to originate from a terminal, login via telnet to a remote system, a intiate an Xterm program.

Here is roughly how it looks...

xhost +

(echo "login"
sleep 2
echo "password"
echo "export DISPLAY X.X.X.X:0.0"
echo ' Xterm program...blah, blah &'
sleep 10) | telnet X.X.X.X

This telnets fine. It logs in fine. The sleep 10 gives it enough time to initiate the Xterm program. It is my understanding that the "&" should allow the program to operate even after telnet logout.

however, after the sleep 10, the telnet session closes, and the Xterm program along with it. Can anybody tell me if this is a script problem, or a telnet problem?


orgcandman 07-24-2002 11:17 AM

The problem is that the telnet session is holding the xterm's controlling tty. once your telnet session closes, the controlling tty closes. the & only puts it in the background of that terminal. as far as keeping the session open, just leave out the & and I think the telnet session will stay up. if you don't want the telnet session up, I don't know what to tell you.


tyler_durden 07-25-2002 12:34 AM

you can do
xterm -display

this works for me doing ssh then closing the ssh terminal.

Matt00SS 07-25-2002 11:09 PM

Try changing the line:

echo ' Xterm program...blah, blah &'


echo 'nohup Xterm program...blah, blah &'


All times are GMT -5. The time now is 01:58 PM.