Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Suggestions for auto-login script for ZSH?



> I'm trying to write a script that would allow be to make telnet login (or
> ftp login) processes automated.  Here's what I tried:
> 
> #!/home/u1/mariah/bin/zsh
> telnet host.com
> echo 'loginname'
> echo 'password'
> 
> 1. ftp
> 2. login
> 3. password
> 4. get a particular file
> 5. exit :)

The problem is that the login process reads the tty directly,
when getting the password.  No amount of shell redirection can
get around this.

The best solution is to retrieve the program "expect" which is
a tcl extension.  It allow you to automate many things which are
generally interactive, such as rlogin/telnet, changing passwords,
ftping, etc...  It is easy to build

I would also recommend Don Libe's book "Exploring Expect" from
O'Reilly.  It is an excellent book.

Check out the expect home page at:

http://elib.cme.nist.gov:80/pub/expect/

rc



Messages sorted by: Reverse Date, Date, Thread, Author