I probably would have done it that way too, if it hadn't "just grown" from a single line to multiple lines. I prefer echo to cat with a HERE document for a single line. The plus of cat is that it is simpler and more portable. My "echo" with the "-e" is not portable.
-- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * [email protected] * www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:[email protected]] > On Behalf Of Kirk Wolf > Sent: Friday, November 09, 2012 1:30 PM > To: [email protected] > Subject: Re: .netrc on zLinux - FTP to zos > > A matter of preference, but I prefer Unix "here documents" to echo > whatever > | command : > > ftp <zos> <<EOF > put /some/path/and/file.txt 'zos.output.file' > quit > EOF > > Kirk Wolf > Dovetailed Technologies > http://dovetail.com > > PS> Now if the archaic z/OS shell would only support "process > substitution"... > > On Thu, Nov 8, 2012 at 7:05 PM, John McKown <[email protected]> wrote: > > > <snip> > > > > Another thing that I often do in scripts (with the above in .netrc) > > and even occasionally from the Linux command line is transfer a > single > > file > > like: > > > > echo -e "put /some/path/and/file.txt 'zos.output.file'\nquit" | \ ftp > > <zos> > > > > or: > > > > cd /output/path > > echo -e "get some.file 'zos.input.file\nquit" | ftp <zos> > > > > If you really want, you can even do multiple files: > > > > echo "get 'zos.input.file1' output.file1.txt bin get 'zos.bin.file' > > output.file2.bin quit" |\ ftp <zos> > > > > Note that the above is formatted correctly in that each new ftp > > subcommand in the Linux echo command is separated by a "hard" line > > break. Since this is in a quoted string, the echo command outputs the > > "hard" line break also. So the "ftp" command picks up each line > > properly as a separate subcommand. I use double quotes to surround > the > > data so that I can use single quotes in the commands, as is sometimes > > required to put in an unqualified (complete) DSN. > > > > > > > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send > email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
