Linux on 390 Port <[email protected]> wrote on 03/06/2007 10:45:40
AM:

> Hello,
>
>     Does anyone have a copy of a Shell Script with some FTP commands in
> it that they can share?
>
> FTP from UNIX to VM/CMS ID.
>
> Thanks in advance ....
>
> ...Dave
>
>
>
>
> ----------------------------------------------------------------------
> For LINUX-390 subscribe / signoff / archive access instructions,
> send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or
visit
> http://www.marist.edu/htbin/wlvindex?LINUX-390

Dave,

Here's a simple example that I use on AIX to put some files onto a remote
machine:

#!/usr/bin/ksh

if [ $# -lt 2 ]
then
        echo ""
        echo "$0 ip_addr files"
        echo ""
        exit;
fi

IP_ADDR=$1
shift

ftp $IP_ADDR << HERE
prompt
bin
mput $*
quit
HERE

There are 2 important things to notice:
The "<< HERE" stuff near the ftp command is called a here document.  Both
korn shell and bash support these.
Authentication is done with ~/.netrc.  The format looks like this:

machine 9.56.195.148 login root password t16lnx
machine 9.56.195.149 login root password t16lnx

Ray Higgs
System z FCP Development
Bld. 706, B24
2455 South Road
Poughkeepsie, NY 12601
(845) 435-8666,  T/L 295-8666
[EMAIL PROTECTED]

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to