"Thomas S. Iversen" <zensonic@zensonic.dk> wrote in message
news:slrnbem14d.1so.zensonic@
www.zensonic.dk...
> In article <qfDGa.32$gT.11@news.get2net.dk>, Jimmy wrote:
>
> Et lille script.
>
> #!/usr/bin/expect
>
> set timeout 20
> set name studie.dtu.dk
>
> set user *****
>
> set password *****
>
> spawn telnet $name
> expect "login:"
> send "$user\n"
> expect "Password:"
> send "$password\n"
> interact
Hej Thomas
Tak for det hurtige svar, men jeg har nogle problemer:
Hvis jeg anvender linien:
set host IP PORT (IP er en korrekt IPadrese, PORT en korrekt port)
Får jeg følgende:
[root@fw shell]# ./expect.sh
wrong # args: should be "set varName ?newValue?"
while executing
"set host IP PORT"
(file "./expect.sh" line 5)
Hvis jeg anvender linien:
set host IP:PORT eller "IP PORT" eller "IP:PORT"
Får jeg følgende:
[root@fw shell]# ./expect.sh
spawn telnet IP:PORT
telnet: IP:PORT: Name or service not known
IP:PORT: Unknown host
send: spawn id exp4 not open
while executing
"send "$user\n" "
(file "./expect.sh" line 13)
[root@fw shell]#
Hvad gør jeg galt?
Mvh
Jimmy