Hi all ,
I am trying to write a script to telnet to a single server multiple time ..
i am able to login once .but the loop doesnt seem to be workin . can anyboy help me in this regard.
my Expect script :
cat telnettest
#!/usr/local/bin/expect -f
spawn telnet lilo.sanjose.hgst.com
expect "Name"
send "anilsaka\r"
expect "Password:"
send "*****\r"
interact
My Shell Script :
#!/usr/bin/ksh
i=0
while [ $i -lt 4 ]
do
`expect telnettest`
i=$[$i+1]
done
I am trying to write a script to telnet to a single server multiple time ..
i am able to login once .but the loop doesnt seem to be workin . can anyboy help me in this regard.
my Expect script :
cat telnettest
#!/usr/local/bin/expect -f
spawn telnet lilo.sanjose.hgst.com
expect "Name"
send "anilsaka\r"
expect "Password:"
send "*****\r"
interact
My Shell Script :
#!/usr/bin/ksh
i=0
while [ $i -lt 4 ]
do
`expect telnettest`
i=$[$i+1]
done