Ubuntu :: Shell Script For Telnet Using Expect - Unable To Find The Tutorial
Jan 22, 2010
I need to open a telnet session using a shell script that follows this format:
telnet 10.100.0.1
expect "Password:"
send <password>
[code]....
send "pen" (till the end of lines generated as in |more.... usually we use like 8 space bar buttons after "pen" to generate all)
and I want to redirect the whole generated result of "pen" to results.
View 3 Replies
ADVERTISEMENT
Nov 2, 2010
I'm trying to Use Expect to automate a curl function. basically I don't want to type enter for my script to run. Can anyone point me to a good Expect tutorial?
View 1 Replies
View Related
May 21, 2011
I'm trying to use expect to get data from telnet
Here's my code :
Code:
set equipment [lindex $argv 0]
set trunk [lindex $argv 1]
set fraction [lindex $argv 2]
[Code]....
so in bold letter not send in 1 line, but i want sent it to 1 line
View 2 Replies
View Related
Apr 22, 2010
I am moving my migration forward and am trying to get my expect scripts tested and found one that no longer works. Quite simply, it spawns a telnet session to a router.
#!/usr/bin/expect
set env(TERM) vt100
set timeout 3
set send_human {.1 .3 1 .05 2}
set timeout -1
#
spawn telnet 10.254.3.232
and that's it. The result of the script is that the command to spawn simply shows up on the screen like it is a puts command. On my older openSUSE system, it worked fine. I am running Ubuntu v9.10 desktop, and expect and its libs are patched to the latest rev, expect is 5.43.0.
View 1 Replies
View Related
Jul 29, 2010
I have a Thomson TG784 router, where I would like to log in automatically and execute dhcp server lease flush command.
When I log in using telnet, the process is following:
Code:
View 6 Replies
View Related
May 6, 2011
find and install EXPECT package in RHEL5 to TELNET servers.
View 2 Replies
View Related
Dec 2, 2010
I have a TCL expect script that spawns a telnet session to a Nortel DMS100 to execute some commands. The strange thing is that the response in expect_out is not consistent. It sometimes contains a extra enter or newline. This results in differences in the expect out buffer. Here is a part of the script:
send "time
"
sleep 1
expect -re ">"
[code]...
This command displays the time. The correct output should be (with log_user=1):
>time
Time is 11:44:04
>
But sometimes the output is:
>timeTime is 11:45:04
>
As you can see here the is missing on the command that expect sends , or at least in the echo that is comming back. I use a split command to filter out the response in the expect_out buffer, but this fails when the is missing. Here is a example with the debug enabled:
[code]....
I suspect it has something to do with a slow response of the switch. I tried to send the time command slow and with the send_human but the result is the same. A timeout between the send and expect also doesn't help.
View 1 Replies
View Related
Jul 18, 2010
I have recently loaded Linux Mint on an old IBM Laptop and am very happy with the GUI; however, I would like to learn how to use the Linux shell/terminal. I don't know any of the commands. Is there a good online source for this information--a tutorial or list?
View 2 Replies
View Related
Jan 13, 2011
I'm really new here this is the first try to get some knowledge here.I have a littele question."echo {1,2}" does expands 1 and 2.so does "echo "`echo {1,2}`"".But when I do it with double quotes which is "echo "{1,2}"" it doesn't expand at all.why does this happen? I have read man for bash but could not get any clue.
Yuki
Code: -- the output i see --
sh-3.2# echo {1,2}
[code]...
View 3 Replies
View Related
Nov 19, 2009
Is it possible to have an Expect script spawn an SSH session, log in, then go into interactive mode and give control of the SSH session to a Bash script? Here's a simplified example of the script so far:
Code:
#!/bin/bash
expect -c "
[code]....
View 4 Replies
View Related
Sep 30, 2010
I want to start learning GUI bash scripting but I can't find the right tutorial. I'm interesting at creating menus like ex. IPTRAF or MC (midnight commander) but all i find is tutorials for KDE & GNOME. The idea is that I want to create programs that don't need X sessions.
View 2 Replies
View Related
Mar 25, 2011
I'm new to Ubuntu and am looking for the Tcl/Tk extension Expect. I have several Expect scripts that I would like to use but I don't know where I can find a version of Expect that will work with Ubuntu 10.10.Does anyone know where I can download this?
View 1 Replies
View Related
Jul 27, 2010
I am trying to make a script that can be used to check server load on a remote server and produces sound on our local machine, when server load exceeds a particular limit.1. I want to execute command uptime or uptime | awk '{print$10}'on the remote server and store the result in a variable(say x), and later use it in the bash script.
Bash Part
#!/bin/bash
x=$(/root/Desktop/exp)
[code]...
View 1 Replies
View Related
Jun 16, 2010
I am writing an expect script. At a certain point there is a rule that produces this debugging output:
Code:
expect: does " Address or name of remote host [x.x.x.x]? " (spawn_id exp8) match glob pattern " Address or name of remote host [x.x.x.x]? "? no This just times out When I use -exact for the expect keyword it does work What am I doing wrong? THe first should also match in my opinion because it is equal as well. Even if I remove the I still have the same issue if I try without -exact. I don't understand. I tried removing the but still got the same.
View 5 Replies
View Related
Feb 8, 2011
I'll post the entire code here, and then specifically highlight what is just failing in a fashion I'm apparently incapable of fixing a few hours later:
Code:
#!/usr/bin/expect
# The script should be called with a file in the directory called sshServerList
# That file has the following format:
# Line # | Contents of line
[code]....
I've had all kinds of different results and problems, but I've never been able to successfully log into multiple servers, though the first server in the list most times works okay (though might not on this iteration). I'm a bit hack and slash and I would be very greatful not only for a solution, but any tips on how I should have done this and places where I could clean up my code.
View 1 Replies
View Related
May 1, 2011
I Want to run below script withing expect utility
Code:
mystring "abc:-)"
mystring1=${mystring/)/.}
View 2 Replies
View Related
Feb 7, 2010
finally i found the script for telnet automated login session...<<Mod edit: questionable link removed>>
View 4 Replies
View Related
Dec 8, 2010
I have something like the following in my expect script:
Code:
interact {
-nobuffer -re {^s
} {
[code]....
I have put the "^" anchor to match only those pattern that does not have anything before "s" e.g.
1.when I type "s" followed by "enter" key it should match.
2.if I type something like "chess" followed by "enter" key it shouldn't match. the second case is also being matched by the regular expression I have in my code.
View 4 Replies
View Related
Feb 21, 2011
I'm trying to find a "clear" tutorial on how to set up a RAID 1 arrangement. Most of the material I come across is out of date; command-line centric or full of incomprehensible jargon. Can someone point me to a good clear and logical tutorial on setting up raid 1 that applies to a desktop computer running 10.10.
View 2 Replies
View Related
Jun 9, 2010
Want to run some cmds on Marc Greis Tutorial but always gets an error msg- "can't find ns: no such command. How can I resolve it? Also do not know how to edit on the terminal Have to start afresh anytime I notice a mistake. How can I successfully run a file to get a result. Have not been able to reproduce the result in Marc Greis tutorials.
View 5 Replies
View Related
Jul 21, 2010
Hey even I'm not able to telnet to IPv6 address on port 23
View 2 Replies
View Related
Sep 8, 2010
I was just checking the configuration file of /etc/xinetd.d/krb5-telnet and i thought of enabling the telnet.I modified the configuration file accordingly and restarted the server.
Code:
# cat /etc/xinetd.d/krb5-telnet
# default: off
[code]...
View 2 Replies
View Related
Apr 6, 2011
i am on CentOS 5.5 ,and unable to do the Telnet. SElinux is in Permissive mode and firewall is off. below are the details for the help. i tried it before and after disabling the firewall and SELinux.
[Code].....
View 14 Replies
View Related
Nov 19, 2008
I'am new to expect how do i send function key F12 in an expect script?
View 1 Replies
View Related
Jul 16, 2010
when i try a telnet to a host like that: telnet 10.10.10.10 1234 i got this: telnet: Unable to connect to remote host: Connection refused.
1/ does this mean that the problem is not due to a firewall, but that the host 10.10.10.10 doesn't listen on the port 1234? other way does this mean that my firewall is authorizing traffic on the port 1234?
and when i try a telnet on another port like that: telnet 10.10.10.10 1235 i get: Trying 10.10.10.10 ...
in this case this
2/ does this mean that the firewall is blocking the traffic between my host and the 10.10.10.10 on the port 1235?
View 1 Replies
View Related
Apr 17, 2011
I'm using something like telnet [URL] 25 and it comes back as not being able to connect to host on port 25. I don't have port 25 blocked anywhere. I turned off the firewall and even opened up port 25 on the hardware firewall router. If I ping it I can connect.
View 2 Replies
View Related
Aug 28, 2010
Why am I not able to telnet to a Windows server machine? Is it because the telnet server is not running there? A remote desktop connection works though.
Does a telnet server run by default on a Unix machine?
View 3 Replies
View Related
Jul 26, 2011
linux 5.4(RHEL) and window machine are pinging nicely.able to access window on linux but not linux at window(xp)? xinetd is running on linux as well as telnet service is also running on xp.
View 1 Replies
View Related
Feb 18, 2010
I am trying to find the difference between the above two services. Both are under xinetd and can someone please explain the difference between them (is one more secure than the other one?)
View 1 Replies
View Related
Jul 3, 2011
My system is Ubuntu 11Before I typed "telnet localhost" or "telnet localhost 23". I have make this work below:$sudo apt-get install xinetd$vim /etc/xinetd.conf
defaults{
instances=60
log_type=SYSLOGauthpriv
[code]....
View 1 Replies
View Related