Ver Resposta Única
Antigo 23-07-2008, 04:37   #4 (permalink)
dlabreu
 
Avatar de dlabreu
 
Registrado em: Mar 2008
Localização: South Africa
Distribuição: Centos
Idade: 29
Posts: 34
Agradeceu: 2
Agradecido 3 vez(es) em 3 Posts
Reputação: 14
dlabreu
Padrão

Ola meus amigo!


Muito obrigado pelas dicas , gostei mesmo desse expect, porem nao entendi direito.
Tenho que ter ele instalado na minha maquina?

Achei isso na Net , porem ainda nao entendi o sentido da coisa , sera que tem como vc me dar uma explicao breve?

set timeout 20 #If it all goes pear shaped the script will timeout after 20 seconds.
set name [lindex $argv 0] #First argument is assigned to the variable name
set user [lindex $argv 1] #Second argument is assigned to the variable user
set password [lindex $argv 2] #Third argument is assigned to the variable password

spawn telnet $name #This spawns the telnet program and connects it to the variable name

expect "login:" #The script expects login
send "$user " #The script sends the user variable
expect "Password:" #The script expects Password
send "$password " #The script sends the password variable
interact #This hands control of the keyboard over two you (Nice expect feature!)


Honestamente so preciso que o Script faca um telnet nesse hardware que nao tem nome de usuario so pede por senha, e depois dentro do Telnet preciso digitar R e enter.
Pronto , acabou meu script.

Please me ajudem


Grato


Daniel
dlabreu está offline   Responder com Quote