From owner-freebsd-hackers@freebsd.org Sat Sep 1 12:26:19 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD8BEFEE1B5 for ; Sat, 1 Sep 2018 12:26:19 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:300:2185:a:dead:bad:faff]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61D8489519 for ; Sat, 1 Sep 2018 12:26:19 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [104.207.135.49]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id w81CQHEE016066; Sat, 1 Sep 2018 13:26:17 +0100 (BST) (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id w81CQDD8016065; Sat, 1 Sep 2018 13:26:13 +0100 (BST) (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <201809011226.w81CQDD8016065@donotpassgo.dyslexicfish.net> Date: Sat, 01 Sep 2018 13:26:12 +0100 Organization: Dyslexic Fish To: wojtek@puchar.net, eugen@grosbein.net Cc: wojtek@puchar.net, freebsd-hackers@freebsd.org Subject: Re: how to use ftp(1) in batch mode References: <5B87F083.6080804@grosbein.net> In-Reply-To: User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [104.207.135.49]); Sat, 01 Sep 2018 13:26:18 +0100 (BST) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Sep 2018 12:26:19 -0000 Wojciech Puchar wrote: > thank you. it works. actually even without netrc > > (echo command1;echo command2)|ftp ftp://user:password@server/ If you need something slightly more robust, you may want to look at lang/expect, which uses send/expect sequences similar to kermit and uucp, but with more powerful options: man expect(1): | Expect is a program that "talks" to other interactive programs according to a | script. Following the script, Expect knows what can be expected from a program and | what the correct response should be. An interpreted language provides branching and | high-level control structures to direct the dialogue. In addition, the user can | take control and interact directly when desired, afterward returning control to the | script. cheers, Jamie