Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jun 1998 15:42:36 +0200 (SAT)
From:      Johann Visagie <wjv@cityip.co.za>
To:        brendan@bmkind.lnk.telstra.net (Brendan Kosowski)
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: chat scripts
Message-ID:  <E0yhaHs-0000sm-00@ns.cityip.co.za>
In-Reply-To: <Pine.LNX.3.96.980604225621.4485A-100000@bmkind.lnk.telstra.net> from Brendan Kosowski at "Jun 4, 98 11:10:34 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Brendan Kosowski wrote:
> 
> Does FreeBSD have a SHELL COMMAND that uses an expect/send sequence to
> chat with ANY PROGRAM ???
> 
> eg. Lets say I want to make a script that chats with the ftp program (
> giving it commands automatically and then exitting ).

If you specifically want to automate ftp, then you can use a here document
(depending on your shell):

  ftp -n << END_OF_COMMANDS
  open some.server.org
  user anonymous my@email.address
  cd /some/where
  get some.file
  bye
  END_OF_COMMANDS

Alternatively, you can install "expect" (it's in the ports).  I've never used
it, but I believe it does what you want.

-- V

Johann Visagie | Email: wjv@CityIP.co.za | Tel: +27 21 419-7878

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0yhaHs-0000sm-00>