expect script for remote ssh login and executing commands
I am using following expect script for remote ssh login to raspberry pi and executing command #!/usr/bin/expect set timeout 60 spawn ssh [lindex $argv 1]@[lindex $argv 0] expect "yes/no" { send "yes\r" expect "*?assword" { send "[lindex $argv 2]\r" } } "*?assword" { send "[lindex $argv 2]\r" } expect "pi@raspberrypi ~ $ " { send "ls -la\r" } interact The problem is that this script is able to login into raspberry but when it comes to line for executing "ls -la" command nothing happens. Can anyone help me out with this script? Where I am making mistake? ok if I put exp_internal 1 line in my