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

Reply via email to