FTP query

Hi there,

Can anyone tell me how to use FTP so that I can pipe a text file with FTP commands in. I'd like to use this method in my korn shell so that I can log onto a remote server and collate listings of specific files.

Here's what I'm trying to do:

ftp -v host_server < [i]ftp_command_file [I/]

The ftp_command_file file contains the following:

userid
password
ascii
cd /.../
dir ...
bye

I keep getting the password prompt. Any help would be muchly appreciated.

Kind regards
:frowning:

Try somthing like this:

#!/bin/sh
ftp -v 10.10.10.127 <<EoF >log.file 2>&1
user pass
ascii
cd blah/goober/whee
get whee.blah
dir
bye
EoF

Let me know if you have any questions about this, or you have more problems.