Skip to main content

Questions tagged [expect]

Expect is a utility based on TCL. It's primary use is for building automation into interactive environments such as telnet or ssh based terminal environments. It provides the ability to enter commands on a command line and interpret the output.

0 votes
0 answers
112 views

I am having issues with the below script. I am trying to replace a line in /etc/sudoers file but need to do it using sudo and either input my password or as in example here, put it in a variable. #!/...
john's user avatar
  • 1
0 votes
0 answers
69 views

I have an expect script that helps me during installation of a certain file. The installation process includes a couple of [yes/no] questions and then the actual installation begins. The [yes/no] ...
Priyansh Mehta's user avatar
0 votes
0 answers
768 views

I'm trying to read data from a machine that uses a telnet style interface using expect. An interactive telnet session works like this: % telnet 10.92.177.14 53595 Trying 10.92.177.14... Connected to ...
Elliott B's user avatar
  • 1,427
7 votes
1 answer
1k views

Expect scripting is great for writing tests that are basically "make sure that running this command causes these logs to be printed". Expect lets you skip past the irrelevant output and look ...
Woodrow Barlow's user avatar
0 votes
1 answer
164 views

I find myself having to do a series of ssh in order to get to a particular host. What I currently do is to copy and paste the commands into the terminal, one after the another, like a machine. I'm ...
Jeenu's user avatar
  • 407
0 votes
1 answer
514 views

I am trying to use expect to interact with the MATLAB console. Currently I have: #!/usr/bin/expect -f spawn {*}/usr/bin/run.sh matlab -r "fprintf(1, \"The identifier was:%s\\\\n\", \&...
user3711775's user avatar
2 votes
1 answer
7k views

I was testing a expect script and found two different behaviors when using set timeout vs. expect -timeout. Here is a simple example response.sh: #!/usr/bin/bash sleep 2 echo hello test1.sh: #!/usr/...
user3711775's user avatar
0 votes
1 answer
830 views

I have a bash that answers the questions that freefilesync asks during installation, using expect: #!/bin/bash tar -xf FreeFileSync*.tar.gz mv FreeFileSync*.run FreeFileSync.run >/dev/null 2>&...
acgbox's user avatar
  • 844
1 vote
1 answer
3k views

This script is intended to mount the contents of my server at home as a read/writeable drive in mac os. Unfortunately due to the fact that my house has a dynamic public ip address, the ip address of ...
Christian Maxwell's user avatar
0 votes
1 answer
1k views

I want this expect script to run forever (or until "ok" is printed), however it does not and exits right away. #!/usr/bin/expect set timeout 180 spawn ssh -o "StrictHostKeyChecking no&...
michelemarcon's user avatar
0 votes
2 answers
707 views

I want to execute a script remotely with expect and a for loop: #!/usr/bin/expect set timeout 10 spawn ssh [email protected] expect "password: " send "pass\n" expect "$ " ...
michelemarcon's user avatar
0 votes
1 answer
6k views

I have an array, $HOSTS, which contains a set of hostnames. I have a database table that has a set of IP addresses. I want to go through each IP address in that table and send a command (hostname -s) ...
Kefka's user avatar
  • 1,546
0 votes
1 answer
2k views

I have a simple expect script that supplies password 4 times. I am logging the output to a log file using log_file -a /home/applusr/e291505/logs/ADD.log spawn /home/root/admin/add.mims.user $...
Uday's user avatar
  • 11
0 votes
0 answers
246 views

I have an expect script that spawns a process, then does some initialization (authentication), then performs some task that needs prior authentication. Considering to extend the script to execute ...
U. Windl's user avatar
  • 1,289
0 votes
1 answer
322 views

I have a basic scp sending mechanism with spawn, expect and send. However it gets aborted during the scp transmission. Here is the expect command: expect -c "spawn sh -c {scp -r -P 22 /tmp/rootfs/* ...
Daniel's user avatar
  • 687

15 30 50 per page
1
2 3 4 5