Ubuntu Installation :: Where To Find Expect That Will Work On10.10
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?
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?
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.
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.
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.
I was wondering if you could help me find a good documentation about expect, I have searched all the web but with no luck. I need to build a complex script that I need at work to automatically connect to 50 pc`s (with linux based os) and execute 10 or more script with the output into a text file and the email the file to my email address.
for the past 3 days i have tried everything i can find on the internet to get ubuntu to work. I am running a brand new Hp Dv4 laptop. I have downloaded, and installed Ubuntu. When i go to boot it, it takes me to a page where it says it needs to finish the install, and counts down from 5. If you let it complete that, it will go to a black page and sit there forever. Push ctrl + alt + del, and it will take you back to the page where you can choose Windows 7 or Ubuntu.
Go back to ubuntu, this time when it counts down i push Esc, and i have several choices. I have tried them all with the same results, except Demo mode. In demo mode, i get a black screen, and the sound of drums. But it still just sits there. I have tried doing ctrl +alt + f1 in each of the different modes, nothing. Just a black screen.
I'm using a small "expect" script to automate password entry for some file copying.The automation works fine, but the "Password: " prompt still displays on the screen. How do I hide the prompts so the user doesn't see "Password: " on the console?Here's the relevant section of my script:
I've got an Expect script that establishes a ssh connection to the iLO interface of a server. Problem is it drops me back to the local terminal and I can't enter commands to be executed on the remote host. How do I get it so it logs me into the server then leaves me connected to it?
I have a script which uses a function and also uses expect.
If I have #!/bin/bash as the first line, the function is recognised. The expect calls are not, failing first with spawn.
If I have #!/bin/expect as the first line, the expect and spawn work fine. The function is not recognised.
My friend Google brings up examples with both these lines one after another in script files, just like Im doing. Except for me it doesnt appear to work.
Where am I making my beginners mistake in not understanding how this works ?
I'm using expect to log into a remote server and run a script. I want to able to have expect edit the output from that script, on the remote server, in VI. Has anyone ever done this before, it seems as though the expect interpreter has nothing to expect once VI is started, the file pointer starts at the beginning of the line, and expect usually reads the characters before the pointer.
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.
I wrote an expect script that tests user authentication against a RADIUS server. The username is an email address, including an @ sign. I recently wrote an HTML/PHP front end to allow others to input username/password into a form and then see the results when they hit submit. Expect code that takes two args username, and password
Every works as it's supposed to, except for the output of the script. When it displays on the webpage, it's segmented weirdly with all throughout. What I've found is when I remove the @ sign in the username input, it fixes it. Is there any part of HTML or PHP that treats the @ as a special character? 1 more thing is that I have another HTML/PHP/EXP script that works fine with the @.
I am starting a new job, and need to brush up on my expect scripting. does anyone know of any online resources, e.g. telnet sites that I can play about with?
I encountered a doc file recently that opened noticeably differently in OOo than it did in MS Office. I think the difference was a small change in spacing that pushed some text onto the next line. It's also feasible that the problem was on my end. My question has this.
1. Should I expect OOo compatibility with text-only .doc files to be absolutely, 100% perfect? 2. If not, any insights on where the problems usually are?
I am working on telnet session and excuting commands. I am able to redirect or store expect output to log file but now i want to store in excel file like ispreadsheet showing details of commands and its responses
Is there a similar thing in expect, as there is 'read'(Read a line from standard input) in bash?I mean one could easily construct following script in bash:
I am trying to embed expect in my bash script to perform some tasks
USER="username" PASS="password" NAMES=`cat full_list` for i in $NAMES do echo $i
[Code]....
The script initially reads a files containing a list of rpm's on each line and then spawns the rpm2ipc command which uploads the particular rpm to a repository. During this process it tries to enter the credentials, where it is failing.
We have a vendor supplied device that requires user interation, so we are using expect to automate the process. unfortunately the vendor may change the prompts as we take patches, which breaks our expect script. What I need to do is find a way to evaluate whether or not the prompt expect receives matches and if it doesn't I want the script to exit and throw an error. Currently it times out and then moves on to the next prompt.
How do I make my expect script exit if the prompt doesn't match?
I am having some difficulties with an expect script. What I want is that as soon as expect sees a newline followed by a dollarsign ($), that interact is done. So I would expect something like this to work:
Code: " $" { interact } However it doesn't. This is debugging output: Code: expect: continuing expect expect: does " " (spawn_id exp6) match glob pattern "#"? no
just as an excercise I'm trying to write a script that would automaticly install java using an expect script.I create the expect script with autoexpect and it works. But only if I don't change the size of the window. It always hang at the line with "--More--". So I changed the script and it boiled down to this
Code: set force_conservative 0 ;# set to 1 to force conservative mode even if ;# script wasn't run conservatively originally
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.
I want to write a function in expect/tcl which logins into a router. but the syntax is a little confusing .
case 1: router prompts for "username".. {we put in username and password .. if they are incorrect we try with another username and password. if we succeed into getting a prompt we return 1 .. if both username passwords are wrong or we time out we return 0 }
case 2: router prompts for "login" .. {we put in username and password .. if they are incorrect we try with another username and password. if we succeed into getting a prompt we return 1 .. if both username passwords are wrong or we time out we return 0 }
case 3: router prompts for "password" only .. { we login just using the password and get to the enable prompt}