Subject: using 'ftp' from a script
To: None <netbsd-users@netbsd.org>
From: Steve Bellovin <smb@research.att.com>
List: netbsd-users
Date: 03/01/2002 17:14:54
I found that I had to add the "-i" option (turn off interactive mode)
to ftp in a script. The problem is that when you do an "ls" or a
"nlist" with output to a file, it always prompts, even if stdin is not
a tty.
First, I think that interactive mode should default to off if stdin is
not a tty. Second, the current coding style surrounding that variable
-- lots of sections of code save it, tweak it, and restore it -- is
dangerous. The "real" mode can remain as a global, but if it needs to
be changed, the routines that use that value should be passed it
explicitly.
--Steve Bellovin, http://www.research.att.com/~smb
Full text of "Firewalls" book now at http://www.wilyhacker.com