#!/bin/sh
# \
exec expect "$0" ${1+"$@"}
# rftp - ftp a directory hierarchy (i.e. recursive ftp)
# Version 2.10
# Don Libes, NIST
exp_version -exit 5.0

# rftp is much like ftp except that the command ~g copies everything in
# the remote current working directory to the local current working
# directory.  Similarly ~p copies in the reverse direction.  ~l just
# lists the remote directories.

# rftp takes an argument of the host to ftp to.  Username and password
# are prompted for.  Other ftp options can be set interactively at that
# time.  If your local ftp understands .netrc, that is also used.

# ~/.rftprc is sourced after the user has logged in to the remote site
# and other ftp commands may be sent at that time.  .rftprc may also be
# used to override the following rftp defaults.  The lines should use
# the same syntax as these:

set file_timeout 3600		;# timeout (seconds) for retrieving files
set timeout 1000000		;# timeout (seconds) for other ftp dialogue
set default_type binary		;# default type, i.e., ascii, binary, tenex
set binary {}			;# files matching are transferred as binary
set ascii {}			;# as above, but as ascii
set tenex {}			;# as above, but as tenex

# The values of binary, ascii and tenex should be a list of (Tcl) regular
# expressions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions would force t (secsions.  For example, the following definitions w