Expect Script Return Value
问题 I'm including simple Expect commands within a bash script (I know I could be just writing a pure Expect script but I would like to get it to work from within bash). The script is below: #!/bin/bash OUTPUT=$(expect -c ' spawn ssh mihail911@blah.org expect "password:" send "dog\r" ') Upon ssh'ing to the above address, it will return something of the form mihail911's password: on the prompt so I think my expect line is valid. When I run this my script does not print anything. It does not even