I have an expect script, and want to spawn a BASH command for it to provide input to. When I use the following syntax:
spawn /bin/bash docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki`
or:
spawn docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
I get the following error:
bad flag "-it": must be -glob, -regexp, -exact, -notransfer, -nocase, -i, -
indices, -iread, -timestamp, -timeout, -nobrace, or --
while executing
"expect {
spawn (/bin/bash) docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn
ovpn_initpki
"Enter PEM pass phrase:" {send "DefPEMVPNPassPhra..."
(file "addcontainer.exp" line 7)
How do I tell expect to spawn a BASH command?
spawn
command insideexpect
, do what I suggested in your previous question