LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Telnet script (https://www.linuxquestions.org/questions/programming-9/telnet-script-271565/)

pirra 12-29-2004 12:23 PM

Telnet script
 
Hi
I use redhat and need a telnet script in bash,
so I CTRL+C CTRL+V this:

#/bin/bash
(sleep 10s
echo "login"
sleep 3s
echo "senha"
sleep 5s
echo "sh atm sub atm 1/3.115127"
sleep 5s
echo "exit"
) | telnet X.X.X.X


But it just doesn't work....

'leep: intervalo de tempo inválido `10s
Tente `sleep --help' para mais informação.
'leep: intervalo de tempo inválido `
Tente `sleep --help' para mais informação.
'leep: intervalo de tempo inválido `
Tente `sleep --help' para mais informação.
'leep: intervalo de tempo inválido `
Tente `sleep --help' para mais informação.
: Name or service not known
: Unknown host
: command not foundne 11:

david_ross 12-29-2004 03:04 PM

Welcome to LQ.

You would probably have more luch use an expect script. Or even better, jsut use ssh instead of telnet.


All times are GMT -5. The time now is 04:52 AM.