If I use #!/bin/expect,it works
Code:
#!usr/bin/expect -f
set password my_passwd
spawn ssh my_user@my_ssh_server
expect "*password: "
send "$password\r"
interact
But when I use expect in shell script,it doesnt work
Code:
#!/bin/bash
/usr/bin/expect <<EOF
set password my_passwd
spawn ssh my_user@my_ssh_server
expect "*password: "
send "$password\r"
interact
EOF
How to use expect in shell script?
Thanks.