Trying to write a simple shell script to ssh into a server and then run a tail for error logs, but I'm getting an error saying "spawn command not found". I'm using expect rather than bash and have checked /usr/bin and it is there. Script is:
#!/usr/bin/expect -f
echo "starting tail"
echo "password for the box?"
read -s theBoxPassword
spawn ssh root@10.0.0.10
expect "root@10.0.0.10's password: "
send $theBoxPassword\r
Not exactly sure what the problem is. I've looked at a bunch of examples online and it seems like I have the shebang thing right and the syntax correct. Any ideas?