I try to install expect from freebsd 's pkg, but when I try to use it,wright a script :
#! /bin/sh
spawn telnet 192.168.1.16
expect "User:"
send <jchen\r>
expect "Password:"
send <winner\r>
interact
Is it right, I got error "spawn: not found"
but I really didnot know where can I find it ,
and what is it? What should I do ?
I only want use the script to login remote server,
using tar to expand a tar file and login root
to exceute a shell.