Hi,
I am new to the expect scripting.
I have this expect script as below :
spawn ssh remote_server -l id
set pass "12345"
set opt "s"
expect "Password:" {send "$pass\r" ; }
expect "*ENTER*" {send "Enter\r"; exp_continue }
expect "Please select option :" {send "$opt\r";}
Next, I need to execute a shell script present on the remote_server & this script uses environment variables within. So, I need to ensure that the remote script picks up correct environment variables. What's the best way to achieve it ?