![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Hello, i am trying to use telnet inside of a ksh script. i would like to do like the following: Code:
#!/bin/ksh ... user="user" hostname="hostname" telnet -l $user $hostname |& wait #end of the ksh and with this piece of code, i would like to telnet another machine, and let the user use telnet to work on the other machine. It's like if the command was typed directly into the command prompt: the user then enters the password and continues working on the other machie until he types "exit" then he returns back to the first machine. But it doesn't seem to work, i get "connection closed by foreign host" at the end of my script. I hope you understand my problem. Can you please help ? And idially, i would also like the script to enter the password automatically, if possible, but it's optionnal. thank you very much. Code:
$ uname -a SunOS machinename 5.10 Generic_127111-06 sun4u sparc SUNW,Sun-Fire-V490 |
|
|||
|
you're right it's easier. but actually i had a problem using rlogin, it takes a long time before returning an error: Code:
prompt $ rlogin XX.XX.XX.XX ::ffff:XX.XX.XX.XX: Connection refused prompt $ telnet XX.XX.XX.XX Trying XX.XX.XX.XX... Connected to XX.XX.XX.XX. Escape character is '^]'. login: but you know what, it's because i was using rlogin on the same machine, i guess that was the problem. Thank you very much, i'm gonna switch back to "rlogin" ![]() ---------- Post updated at 02:19 PM ---------- Previous update was at 02:03 PM ---------- actually the was never the problem (rlogin to own machine) do you know what could cause the "Connection refused" problem when using rlogin instade of telnet ? |
|
|||
|
thank you for your reply.
but it still prompts me for the user and the password (i'm sure i have the "-l" option set). i guess it is my only option ![]() |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| unix telnet ksh |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| variable inside variable inside loop headache | hcclnoodles | Shell Programming and Scripting | 6 | 06-18-2009 05:55 PM |
| value inside a function | trichyselva | Shell Programming and Scripting | 2 | 08-04-2008 08:44 AM |
| Webpage to Telnet via Perl and Expect: Telnet problem? | jondo | Shell Programming and Scripting | 1 | 07-22-2008 01:35 AM |
| looping a array inside inside ssh is not working, pls help | reldb | Shell Programming and Scripting | 5 | 07-07-2006 11:32 AM |
| inside the JVM | rein | UNIX for Advanced & Expert Users | 1 | 08-05-2005 02:57 PM |