How does one use Expect with Git interactive CLI w/out resorting to...
Typically, I can use the expect mechanic of expect followed by send. In the case of git's interactive shell, however, this does not work and I must use puts.Is there some trick to restore the normal...
View ArticleHow to use single quotes with expect -c "send ..."
This works as expected:$ expect -c 'send "one two three"'one two threeThis however doesn't:$ expect -c "send 'one two three'"usage: send [args] string while executing"send 'one two three'"The problem...
View Articleexpect script regular expression not working
In expect script I am trying to capture some text from outputText in output is like ivalue=16ef7baa-0de1-48bf-9e04-d486defbee1c,code:expect -re {^(ivalue)\=(.*)(\,)$}puts "expect_out (0, string)"output...
View Articleexpect script doesn't change password on Solaris
I have this script I run from a Linux machine to change root password on remote Solaris machine reachable by ssh.All seems to be fine, passwd command asks for a password, second password, reply that is...
View ArticleUsing expect in bash to execute a command with a password request
I have worked for a while on making a BASH script to go through two lists and creating a command out of it.In the end it should execute the command and synchronize my ZFS server and ZFS backup...
View ArticleExpect: how to properly close a while loop in bash using infinite expect spawn?
I have the following script:#!/usr/bin/expectset timeout 20set cmd [lrange $argv 1 end]set password [lindex $argv 0]eval spawn $cmdwhile {1} { expect "id_rsa" send "$password\r";}interactwhich intends...
View Articleexpect: does "" (spawn_id exp70) match glob pattern
I have written an expect script that works perfect for testing passwords on our network until it has looped through my list quite a bit, then the debug output shows that there is nothing to match.Here...
View ArticleExpect script does continue after putting a value
I wrote the following expect script:#!/usr/bin/expect -fset timeout 10spawn zypper in --no-recommends pdnsexpect { -re {^.* Solution (\d): (?:break pdns)} { set solution "$expect_out(1,string)"...
View Articlebash script for activeDirectory join; facing issues using expect to bypass...
Will preface here stating that this is poor practice but I have been requested anyway to store the svc-account credential within the script which will live in vRA for VM template.. not my choice, but...
View ArticleShell script with EXPECT and PUT to SFTP server
I'm working on a shell script and I'm trying to send a backup file to a sftp server :remotepath=/backup/expect -c "spawn sftp user@172.11.23.4expect "password:"send "password123\r"expect "sftp>"send...
View Articlebash script error stty: standard input: Inappropriate ioctl for device
I'm using here-documents in a bash script to automate installation and setup where a password is required many times. I enter the password once and the script passes it to the various commands. In most...
View Article--- Article Not Found! ---
*** *** *** RSSing Note: Article is missing! We don't know where we put it!!. *** ***
View Articlehow to send special characters in expect script?
I'm trying to send special characters (password) which contains #?!k;|C .The password is dynamic and cannot be hardcoded in the script, so I'm passing it as variable as shown below$ expect...
View ArticleRunning expect in systemd unit causes sh syntax error
I am trying to automate the process of connecting to my VPN (SonicWall NetExtender) from my Linux machine by using a systemd unit to call an expect script that supplies the login credentials to the VPN...
View Articleadding ansible_python_interpreter to task with expect module fails to get...
I'm writing a task for CentOS7 inventory in which have to go through prompt dialogues, which I think is best candidate for andible's expect module.- name: setup some command become: yes become_user:...
View ArticleHow can I use regex to match the contents by using expect?
I am new to expect for using the regular expression. trying to parse below input stream. How it can be parse with regexp. As CNTXID is incremental."Data" CNTXID = 1 AP = 99 DEF = FALSE CNTXID = 2 AP =...
View ArticleHow do you shut down an expect script in the presence of a complex shell...
I am running zsh inside of tmux with prezto, and a basic expect script is exiting improperly:set timeout -1spawn $env(SHELL)expect -regex ".*"send "echo 'foo'\r"expect -regex ".*foo.*\r"send "^D"expect...
View ArticleExpect works fine,but only in foreground why?
I use this script for update my repo slackware(generate asc,txt,etc)http://slackware.org.uk/people/alien/tools/gen_repos_files.shI have "automated" it with my expect script#!/bin/bashset...
View Articleexpect script terminating early in Dockerfile
I've got an expect script that I need to run in a Dockerfile. However, the script is terminating after all of the input is sent. What's interesting is that docker build is succeeding. Here's my...
View ArticleWaiting until an application is reading (over a TTY)
I'm writing an expect-style program to interact with a command-line application on Linux. Is there any way that my program can know when the application on the other side of the PTY tries to perform a...
View Article