LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-29-2004, 01:23 PM   #1
pirra
LQ Newbie
 
Registered: Dec 2004
Posts: 1

Rep: Reputation: 0
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:
 
Old 12-29-2004, 04:04 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Welcome to LQ.

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can we telnet the system using shell script suchi_s Programming 18 02-18-2005 03:43 PM
telnet script help GUIPenguin Linux - General 2 01-16-2005 03:48 PM
Telnet script?? mike400hp Linux - Newbie 6 08-22-2003 04:41 PM
telnet script tn1681 Linux - General 3 07-25-2002 11:09 PM
telnet script tn1681 Programming 2 07-24-2002 09:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration