tcl - How to spawn from a variable in Expect -


there processes take in password partway through computation. wish insert password @ start of process, trying create generic expect script spawn process, give password.

this expect script takes in password enter , process spawn:

#!/usr/bin/expect  set timeout 120  # program spawn , password send set pswd [lindex $argv 0] set program [lindex $argv 1]  spawn $program  expect "password:" send "$pswd\r"  interact 

this called bash function:

function vup {     echo -n "enter password: "     read -s pswd     echo     expectpassword.exp $pswd "vagrant up" } 

but error:

couldn't execute "vagrant up": no such file or directory     while executing "spawn [join $program]" 

this script seems work when use on program without arguments. i'm not sure how make work 1 variable number of arguments.

one way use eval:

eval spawn $program 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -