Ich habe dieses Expect Script
#!/usr/bin/expect
set command [lindex $argv 0]
set timeout 20
spawn ssh loginuser@172.31.2.2
expect "password:"
send "xxxxx\r"
expect "> "
send "sudo -i\r"
expect "password:"
send "xxxxx\r"
expect "# "
send "$command\r"
send "exit\r"
send "exit\r"
expect eof
Kann ich die Rückgabe des Befehl "$command" in der Bash weiterverarbeiten? Also so auf die Art
var = send "$command\r"
return var