This is the mail archive of the
mailing list for the Cygwin project.
Re: scripting sftp in a bash script
On 2003-12-02, David Strozzi <dstrozzi@MIT.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:
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*).
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html