Tag Archives: EOT

Help Simple FTP Script Here Syntax

By gdotoli

I have a list of IP address and want to be assess whether FTP is allowing
FTP access. I don’t want to use lousy NT shell, but cannot get the syntax down on this. ftphosts.txt is a simple list of IP adresses.
I want to iterate through the IPS and do a simple

ftp IPadress
user ftp password test@abc.org
Then lcd to c:investigate and get all the files in the root.
Please help me with this syntax. I am running this in a Cygwin bash shell.
Thak you in advance for your help!
Gregg Dotoli

#!/bin/bash -vx
for g in `cat ftphosts.txt`; do echo $g
ftp -u $g<<++EOT++
user ftp ftp@anonymous.com
bin
lcd c:investigate
hash
bell
mget *.*
user <ftp@aol.com>
bin
mget *.*
quit
++EOT++

From: http://www.unix.com/shell-programming-scripting/221271-help-simple-ftp-script-here-syntax.html