I have an expect script which performs an SSH to a list of servers with the credentials mentioned in the script. It is not throwing any error when it is unable to SSH to a particular server and continues with the next server in the list. I want the script to let me know when it is unable to SSH with the password given. What changes should be made to the script to get this done?The first script is a shell script which calls the expect script#!/usr/bin/kshfor host_name in `cat list`do    /home/user1/ssh_script $host_namedone#!/usr/local/bin/expect -fset timeout 1set host_name [lindex $argv 0]spawn ssh -q -o StrictHostKeyChecking=no user1\@$host_nameexpect *assword:send abcd@123\r;expect $\rputs user1 loggedin successfullyexitinteract
Need Modifications in my expect script
expect