Here is one way of embedding expect inside of Bash
#!/bin/bash USER="root" HOST="192.168.1.111" PASS="secret" expect -c " spawn ssh $USER@$HOST expect \"password:\" send \"$PASS\r\" interact "
Advertisements
Here is one way of embedding expect inside of Bash
#!/bin/bash USER="root" HOST="192.168.1.111" PASS="secret" expect -c " spawn ssh $USER@$HOST expect \"password:\" send \"$PASS\r\" interact "
Excellent. Thank-you.
I understood that the quotes needed to be escaped in the expect section, but I was trying to escape the \r as well