(PARA PROGRAMAS INTERATIVOS)
O comando "expect" é usado para enviar "strings" quando programas interativos solicitam informações.
Instalação
# apt-get update ; apt-get install expect
EXEMPLO COM O SSH
# vi test_expect_ssh.sh
#!/usr/bin/expect
spawn ssh 10.0.0.1 /sbin/ifconfig
expect "password: " { send "12345678\r" }
expect "root"
EXEMPLO COM O SSH COM DEBUG
# vi test_expect_ssh.sh
#!/usr/bin/expect
exp_internal 1
spawn ssh 10.0.0.1 /sbin/ifconfig
expect "password: " { send "12345678\r" }
expect "root"
Arquivo de configuração

Referências Bibliográgicas