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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

telnet session in background...

Status
Not open for further replies.

simpson

MIS
Oct 23, 2001
58
CA
I am attempting to fire up a telnet session in the backgroud via a script. I am not needing to log into the session only to establish the session and create the telnetd process on the remote machine. REASON FOR SCRIPT - I am updating the kernel parm for the number of allowable telnet sessions and want to start up a whole bunch at once. Problem is when you try ( telnet server_name & ) it starts the session but you need to hit enter. I have tried many different string sequences in my script but nothing seems to work. ANY IDEAS???

Thanks
Simpson
 
expect is your friend here. There's a bit of a learnign curve but once you've got it...

Ceci n'est pas une signature
Columb Healy
 
You could start it as a coprocess...
Code:
#!/bin/ksh

telnet someplace.domain.com |&

print -p ""
The "[tt]|&[/tt]" starts the telnet as a coprocess. A "[tt]print -p[/tt]" will send commands to it, and a "[tt]read -p[/tt]" will get the output from it.

You can only have one coprocess that you can talk to at a time, so this might not work for what you're trying to do.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top