delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/12/02/02:10:07

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin AT cygwin DOT com
From: James Hu <jxh AT despammed DOT com>
Subject: Re: scripting sftp in a bash script
Date: Tue, 2 Dec 2003 07:09:11 +0000 (UTC)
Lines: 22
Message-ID: <bqhdqn$e2$1@sea.gmane.org>
References: <Pine DOT GSO DOT 4 DOT 55L DOT 0312012315060 DOT 4922 AT scrubbing-bubbles DOT mit DOT edu>
X-Complaints-To: usenet AT sea DOT gmane DOT org
User-Agent: slrn/0.9.8.0 (CYGWIN_NT-5.0)

On 2003-12-02, David Strozzi <dstrozzi AT MIT DOT EDU> wrote:
> I'm trying to use sftp within a bash script on cygwin (version 1.5.5 on
> winXP pro).  Ideally I'd like to use a 'here document' rather than using
> an external batchfile...

> ... are there other ways to script/call sftp (or a _secure_ equivalent)?

sftp has its own batch file facility.  From the sftp man page:

     -b batchfile
             Batch mode reads a series of commands from an input
             batchfile instead of stdin.  Since it lacks user
             interaction it should be used in conjunction with
             non-interactive authentication. sftp will abort if any
             of the following commands fail: get, put, rename, ln,
             rm, mkdir, chdir, ls, lchdir, chmod, chown, chgrp, lpwd
             and lmkdir.  Termination on error can be suppressed on a
             command by command basis by prefixing the command with a
             `-' character (for example, -rm /tmp/blah*).


-- James


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019