From owner-freebsd-questions Thu Jun 4 07:19:16 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA12765 for freebsd-questions-outgoing; Thu, 4 Jun 1998 07:19:16 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from ns.cityip.co.za (ns.cityip.co.za [196.25.223.140]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA12645 for ; Thu, 4 Jun 1998 07:18:43 -0700 (PDT) (envelope-from wjv@cityip.co.za) Received: from wjv by ns.cityip.co.za with local (Exim 1.82 #2) id 0yhaHs-0000sm-00; Thu, 4 Jun 1998 15:42:36 +0200 Subject: Re: chat scripts In-Reply-To: from Brendan Kosowski at "Jun 4, 98 11:10:34 pm" To: brendan@bmkind.lnk.telstra.net (Brendan Kosowski) Date: Thu, 4 Jun 1998 15:42:36 +0200 (SAT) Cc: freebsd-questions@FreeBSD.ORG X-PGP: ftp://ftp.cityip.co.za/users/wjv/pubkey.asc X-URL: http://www.cityip.co.za/~wjv/ X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: From: Johann Visagie Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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