Subject: bin/16132: ftp's 'ls' to a file is interactive, even in a script
To: None <gnats-bugs@gnats.netbsd.org>
From: None <smb@research.att.com>
List: netbsd-bugs
Date: 03/30/2002 12:53:50
>Number:         16132
>Category:       bin
>Synopsis:       ftp's 'ls' to a file is interactive, even in a script
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 30 09:54:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Steven M. Bellovin
>Release:        NetBSD 1.5.1
>Organization:
AT&T Labs Research
>Environment:
	
System: NetBSD berkshire.research.att.com 1.5.3_ALPHA NetBSD 1.5.3_ALPHA (BERKSHIRE.nosound) #5: Wed Feb 20 22:37:19 EST 2002 root@:/usr/src/sys/arch/i386/compile/BERKSHIRE.nosound i386


>Description:
	When you do an 'ls' inside of ftp and specify an output file
	(i.e., 'ls . /tmp/xx' or 'nlist /pub /tmp/xx'), it prompts
	to ask if you really want to write the output to a file.  That's
	fine for interactive use (though rather non-Unix like, but that's
	another story).  But it issues the same prompt even for non-
	interactive ftp sessions, such as ftp from a script.  That's
	wrong.
>How-To-Repeat:
	cat >/tmp/xx <<EOF
	ls . /tmp/yy
	EOF
	ftp -a ftp.netbsd.org </tmp/xx
>Fix:
	-i is a workaround, but it shouldn't be needed in this case.
	There's already a variable inside ftp that knows it's got
	stdin from a tty; its value should be checked before that prompt.
>Release-Note:
>Audit-Trail:
>Unformatted: