STDIN in FTP

STDIN in FTP

Post by Me » Tue, 23 Jul 2002 21:28:58



Hi,

I wonder if anyone can help, I'm trying to write a script to simply FTP some
files using standard input from a file. I have a script file containing :-

ftp < infile

and the file "infile" containing :-

OPEN server_name

usrname

password

The problem is that when you run the script, it hangs on the following
prompt :-


Password:Name (server_name:myusrname): _

Is it that FTP simply wont allow the password to be passed to it from a file
or am I doing something else wrong ?

Thanks

Paul.

 
 
 

STDIN in FTP

Post by Les Troye » Tue, 23 Jul 2002 23:31:39


This is usually done with

ftp -n hostname <redirect

the -n disables the autologin feature that is causing the prompt

Les


> Hi,

> I wonder if anyone can help, I'm trying to write a script to simply FTP some
> files using standard input from a file. I have a script file containing :-

> ftp < infile

> and the file "infile" containing :-

> OPEN server_name

> usrname

> password

> The problem is that when you run the script, it hangs on the following
> prompt :-


> Password:Name (server_name:myusrname): _

> Is it that FTP simply wont allow the password to be passed to it from a file
> or am I doing something else wrong ?

> Thanks

> Paul.


 
 
 

STDIN in FTP

Post by . » Wed, 24 Jul 2002 01:16:03


try storing the username and password in your .netrc file
( man netrc ).


> Hi,

> I wonder if anyone can help, I'm trying to write a script to simply FTP
some
> files using standard input from a file. I have a script file containing
:-

> ftp < infile

> and the file "infile" containing :-

> OPEN server_name

> usrname

> password

> The problem is that when you run the script, it hangs on the following
> prompt :-


> Password:Name (server_name:myusrname): _

> Is it that FTP simply wont allow the password to be passed to it from a
file
> or am I doing something else wrong ?

> Thanks

> Paul.

 
 
 

STDIN in FTP

Post by Gary R. Hoo » Wed, 24 Jul 2002 01:48:54




> > I wonder if anyone can help, I'm trying to write a script to simply FTP
> some
> > files using standard input from a file. I have a script file containing

> try storing the username and password in your .netrc file
> ( man netrc ).

And you might also try using the "macdef init" macro in your .netrc
file.
You can construct an entire series of ftp commands to be automatically
executed when you fire up your connection to a specific machine.
This would be documented in the ftp manual page in the pubs.

--
Gary R. Hook / AIX PartnerWorld for Developers / These opinions are MINE
________________________________________________________________________

 
 
 

STDIN in FTP

Post by Frank da Cr » Wed, 24 Jul 2002 03:04:52




: ...
: And you might also try using the "macdef init" macro in your .netrc
: file.
: You can construct an entire series of ftp commands to be automatically
: executed when you fire up your connection to a specific machine.
: This would be documented in the ftp manual page in the pubs.
:
People who are interested in automating ftp transactions should be aware
of a new FTP client that is innately scriptable:

  http://www.columbia.edu/kermit/ftpclient.html

Integrated scripting capability in the FTP client itself, with access to
the FTP connection itself and FTP protocol messages and codes, combined
with the ability to reliably test the success or failure of each operation,
make decisions, use normal programming constructs like variables, arrays,
blocks, and loops, flexibly select files, etc, has distinct advantages over
the traditional options for FTP automation.

It's all explained here:

  http://www.columbia.edu/kermit/ftpscripts.html

- Frank

 
 
 

STDIN in FTP

Post by Claudiu COSTI » Sun, 28 Jul 2002 00:06:46


     Correct use is for example:

ftp -n <infile

The infile contain:

prompt
open my.ftp.server.com
user claudiuc password
ls -l
bye


> Hi,

> I wonder if anyone can help, I'm trying to write a script to simply FTP
> some files using standard input from a file. I have a script file
> containing :-

> ftp < infile

[snip]

kind regards,
--
Claudiu Costin

 
 
 

1. redirect stdin/stdout does not for the ftp client child process

Hi,

I understand one can use pipes and fork out a child process and
redirect the child's stdin/stdout to the pipes so the parent process
can interface with the child process via stdin/stdout.

I also tested the code to be working for simple child process.
However when I run ftp client with the child process, it does not
work.  I can get ftp client to recieve my login name and prompt me for
password.  But there is nothing after that, the system just hang.

I know the alternative solution is to use a psuedo-terminal.  But I
want to understand why it does not work?  Something to do with
terminal I/O control?  Can it be configured to work?

TIA

2. AMD for solaris

3. FTP put from stdin (in script)???

4. Missing Headers

5. Solaris ftp v Pro-ftp v WU-ftp

6. DELL customer service

7. FTP: New Linux FTP site: ftp.kernel.org

8. Netscape aout installs on FBSD 4.0?????

9. Secure ftp, ftp over stunnel og ftp-ssl.

10. In search of Solaris 2.5 Netscape Navigator 3.0 plug ins

11. Need HELP to Log User Log-ins form the internet

12. Suse 7.0; Yast2, kinternet, rc.dialout und ich komme nicht ins Internet

13. Netscape plug-ins on AIX 4