Input required for telnet in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Input required for telnet in script
# 1  
Old 03-07-2010
Input required for telnet in script

Guru,

I am trying to use telnet in unix script.
And it's asking password after executing telnet command in script.

But I don't want to have manual intervention over there.
So is it possible to pass password for telnet from script itself.
What I am doing right now is something like this.


telnet locahost 2233 | sleep 5 < cat tmp

And tmp is having password for the telnet host.

Thnx in advance.

Regards,
gander_ss
# 2  
Old 03-08-2010
# 3  
Old 03-08-2010
Quote:
Originally Posted by gander_ss
Guru,

I am trying to use telnet in unix script.
And it's asking password after executing telnet command in script.

But I don't want to have manual intervention over there.
So is it possible to pass password for telnet from script itself.
What I am doing right now is something like this.


telnet locahost 2233 | sleep 5 < cat tmp

And tmp is having password for the telnet host.

Thnx in advance.

Regards,
gander_ss
Use expect
# 4  
Old 03-08-2010
Dennis could you plz provide sample code ?
# 5  
Old 03-08-2010
Quote:
Originally Posted by gander_ss
Dennis could you plz provide sample code ?
Refer the manuals and prepare& try the script. There are plenty of examples on how to do expect scripting.

Post here if you face any issues.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Best Alternative for checking input parameter contains required value or not

Any good way to check if code has the required output # /sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts net.ipv4.icmp_echo_ignore_broadcasts = 1 /sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts | grep "= 1" net.ipv4.icmp_echo_ignore_broadcasts = 1 What I can think of is above, and it... (16 Replies)
Discussion started by: alvinoo
16 Replies

2. Post Here to Contact Site Administrators and Moderators

Moderator input required please

We have been told to use this method for contacting moderators (rather than PM). Can any moderator please checkout what member 'buyvpn' is up to. Thanks. ---------- Post updated at 11:19 AM ---------- Previous update was at 11:15 AM ---------- Advertising services on at least one post. (1 Reply)
Discussion started by: hicksd8
1 Replies

3. UNIX for Dummies Questions & Answers

Perl Script:how to find how many parameters are required to run the script

How to find how many parameters are required to run a Perl script? (1 Reply)
Discussion started by: Lakshman_Gupta
1 Replies

4. UNIX for Dummies Questions & Answers

Create a file with input values required

Hi Guys Please can you help me to create a file using the following inputs 2351 first input 2339 second input all this rows need to have the value 0 in front 2338 third input 2333 fourth input all this rows need to have the value 1 in front count all the rows in the file and insert the... (10 Replies)
Discussion started by: jiam912
10 Replies

5. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

6. Shell Programming and Scripting

getopts :- expecting required input format

The requirement is, i'm using getopts for calling two different function depending upon the input the user gives. Two functions are 1. help 2. processing function these two functions are written inside the script and if the user gives only the below format the processing function should be... (2 Replies)
Discussion started by: Amutha
2 Replies

7. Shell Programming and Scripting

Getting required fields from a test file in required fromat in unix

My data is something like shown below. date1 date2 aaa bbbb ccccc date3 date4 dddd eeeeeee ffffffffff ggggg hh I want the output like this date1date2 aaa eeeeee I serached in the forum but didn't find the exact matching solution. Please help. (7 Replies)
Discussion started by: rdhanek
7 Replies

8. UNIX for Advanced & Expert Users

password required when using input redirection

Hello, I need to change user and run some commands by using a script. lets say, I'm using su - someuser << start password required -----> how can I enter the password here command 1 command 2 command 3 command 4 start While trying to run this I got the following message: "standard... (2 Replies)
Discussion started by: Alalush
2 Replies

9. Shell Programming and Scripting

Script Required

Hello guys, Need a help.I have a flat file. QWER 2:35 7044 00001 ROUT 1188 EA SS ASD 2:36 7044 00010 ROUT BSD 2:37 7044 00011 ROUT END QWER 3:35 7044 00011 ROUT 1088 EA SS ASD 3:36 7044 00010 ROUT BSD 3:37 7044 00011 ROUT END QWER 2:35 7044 00001 ROUT 1188 EA SS ASD ... (1 Reply)
Discussion started by: Satadru
1 Replies

10. Shell Programming and Scripting

restricting user input as required

Hi, I want the user to enter only numeric values and also he should only enter 2 digits only ( eg 23 or 23 or 03 any 2 digits) For the above purpose how should i declare my variable ? integer value if I read 03 in variable value then it gives me error ...also user can enter n number... (4 Replies)
Discussion started by: dhananjayk
4 Replies
Login or Register to Ask a Question