Hi Bobby,
Please try this example:
HOST='example.com' USER='username' PASSWD='password'
ftp -n ${HOST} <<END_SCRIPT
quote USER ${USER}
quote PASS ${PASSWD}
...
quit
Kind Regards,
Filipe Miranda
On Aug 30, 2013, at 9:59 AM, "Bauer, Bobby (NIH/CIT) [E]"
<[email protected]> wrote:
> That's interesting, it is prompting for the password!?
>
> ftp -inv $HOST << EOF
> user $USER
> PASS $PASS
> put something
> bye
> EOF
>
> 220 Connection will close if idle for more than 1440 minutes.
> Remote system type is MVS.
> (username) 331 Send password please.
> Password:
>
>
> Bobby Bauer
> Center for Information Technology
> National Institutes of Health
> Bethesda, MD 20892-5628
> 301-594-7474
>
>
> -----Original Message-----
> From: Davis, Larry (National VM Capability) [mailto:[email protected]]
> Sent: Friday, August 30, 2013 12:45 PM
> To: [email protected]
> Subject: Re: Bash script for FTP to mainframe
>
> Try sending the Password on a separate line with the PASS command user $USER
> pass $PASS
>
>
>
> Larry Davis,
> VM Capability
>
>
> -----Original Message-----
> From: Linux on 390 Port [mailto:[email protected]] On Behalf Of Bauer,
> Bobby (NIH/CIT) [E]
> Sent: Friday, August 30, 2013 12:30 PM
> To: [email protected]
> Subject: Bash script for FTP to mainframe
>
> Need to write a bash script (RHEL6) to FTP a file to the MVS side of the
> mainframe. Love to use SCP but to my knowledge, it only sends to the OMVS
> side.
> Here is the code with the names changed:
>
> HOST=nih
> USER=me
> PASS=password
> ftp -inv $HOST << EOF
> user $USER $PASS
> put something
> bye
> EOF
>
> and here is the error message.
> Connected to nih (xxx.xxx.xxx.xxx).
> 220-FTPD1 IBM FTP CS V1R13 at nih, 12:03:54 on 2013-08-30.
> 220 Connection will close if idle for more than 1440 minutes.
> Remote system type is MVS.
> (username) 331 Send password please.
> 530 new passwords are not the same
> Login failed.
>
> I know the password is correct. I don't know what it is doing/complaining
> about when it says the new password is not the same. Anybody know how to do
> this?
>
> Thanks
> Bobby Bauer
> Center for Information Technology
> National Institutes of Health
> Bethesda, MD 20892-5628
> 301-594-7474
>
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
> For more information on Linux on System z, visit http://wiki.linuxvm.org/
>
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
> For more information on Linux on System z, visit http://wiki.linuxvm.org/
>
> ----------------------------------------------------------------------
> 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
> ----------------------------------------------------------------------
> For more information on Linux on System z, visit
> http://wiki.linuxvm.org/
----------------------------------------------------------------------
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
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/