From: John D Groenveld on
Good example, thank you.

Still, here's a quick plug for Columbia Kermit which is very useful for
scripting ftp among other things.
<URL:http://www.columbia.edu/kermit/ckscripts.html#ftp>

John
groenveld(a)acm.org
From: hadi motamedi on
> cat << EOM | ftp -n 172.16.17.160
> user-name
> pass-word
> bin
> send docs
> quit
> EOM

Sorry. Can you please provide me more details on this?As I have
understood, you are trying to capture all of the commands on just one
script and then issue that script.Please confirm if I am right.
Thank you
From: webjuan on
On Apr 29, 12:38 am, hadi motamedi <motamed...(a)gmail.com> wrote:
> > cat << EOM | ftp -n 172.16.17.160
> > user-name
> > pass-word
> > bin
> > send docs
> > quit
> > EOM
>
> Sorry. Can you please provide me more details on this?As I have
> understood, you are trying to capture all of the commands on just one
> script and then issue that script.Please confirm if I am right.
> Thank you

If you are referring to the "cat << EOM" portion of the code, its
known as a "here document". Check out the Wikipedia entry for the
details: http://en.wikipedia.org/wiki/Here_document

juan martinez
From: hadi motamedi on
> > > cat << EOM | ftp -n 172.16.17.160
> > > user-name
> > > pass-word
> > > bin
> > > send docs
> > > quit
> > > EOM
> If you are referring to the "cat << EOM" portion of the code, its
> known as a "here document".  Check out the Wikipedia entry for the
> details:http://en.wikipedia.org/wiki/Here_document
Thank you . At now, I can understand it. But when I run it , it just
waits on asking for inputting password (it seems that ftp and
inputting the user-name has gotten through). Can you please let me
know if this problem is related to commands run time speed issue? Can
you please let me know how to modify it?

From: Fred on
On May 1, 5:32 am, hadi motamedi <motamed...(a)gmail.com> wrote:
> > > > cat << EOM | ftp -n 172.16.17.160
> > > > user-name
> > > > pass-word
> > > > bin
> > > > send docs
> > > > quit
> > > > EOM
> > If you are referring to the "cat << EOM" portion of the code, its
> > known as a "here document".  Check out the Wikipedia entry for the
> > details:http://en.wikipedia.org/wiki/Here_document
>
> Thank you . At now, I can understand it. But when I run it , it just
> waits on asking for inputting password (it seems that ftp and
> inputting the user-name has gotten through). Can you please let me
> know if this problem is related to commands run time speed issue? Can
> you please let me know how to modify it?

It's the -n that's causing problems, it skips auto-login. Sorry, typo
in the example.
You need to modify it to this:

cat << EOM | ftp -n 172.16.17.160
user user-name pass-word
bin
send docs
quit
EOM