issues with expect -send: spawn id exp4 not open
Figured out why.I had generated ssh keys and copied it on to the destination machine. So there was no "Password: " prompt. Hence before send could complete, the ssh connection had closed.
I deleted the ssh keys from the destination machine and ran the script again and observed no issues