Computing.Net > Forums > Unix > Telnet script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Telnet script

Reply to Message Icon

Name: Banu Prakash
Date: July 10, 2005 at 22:07:50 Pacific
OS: Solaris
CPU/Ram: 512
Comment:

Iam trying for telnet script for n number of devices at a time Im able to do telnet for a single system, but if i want to do for multiple systems then how i need to do
could any help me out in writong this script.

for i in `cat /u01/home/bprakas/tel`;do
echo $USERNAME
echo $PASSOWRD
USERNAME=xxxxxxx
PASSWORD=xxxxxxx
telnet $i
done


Banu Prakash



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: July 11, 2005 at 05:04:51 Pacific
Reply:

Look into expect.

http://expect.nist.gov/FAQ.html


0

Response Number 2
Name: cislord
Date: July 14, 2005 at 00:14:06 Pacific
Reply:

Hi,
Try something like this. The file "hosts.txt" looks something like this:

hostname1
hostname2
hostname3
10.240.5.47
.
.
.

#!/bin/ksh

export USERNAME=xxxxx
export PDW=xxxxxxxx

cat hosts.txt | while read H
do
( echo open $H
sleep 1
echo $USERNAME
sleep 1
echo $PDW
sleep 1
/somedir/some_script.sh 2>&1 > /dev/null
echo exit ) | telnet
done

Hope this helps


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Telnet script

Can anyone help with telnet script www.computing.net/answers/unix/can-anyone-help-with-telnet-script-/3997.html

Unix telnet script www.computing.net/answers/unix/unix-telnet-script/2856.html

fail exit status for telnet script www.computing.net/answers/unix/fail-exit-status-for-telnet-script/6524.html