The .netrc that I am successfully using on my Fedora 18 (and back to
Fedora 15?) looked like:

machine <zos> login <racfID> password <racfPASS> macdef init
sunique
runique
quote site noasa

The only real difference from yours is that I use "login" where you use
"userid". I also named my macro "init" so that the lines are
automatically send after a successful login. The name "init" is required
to do this. Lastly, I think you meant to type "quit" instead of "quite".
"quit" is quite different from "quite". <grin/>

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.


On Thu, 2012-11-08 at 18:15 -0600, Ruegsegger, Jeff wrote:
> We want to automate some ftp's on our zlunix machine to our zos host.
> I created .netrc like this
> machine mymachine.comp.com userid myzosracfid password myzosracfidpw
> macdef ftptest
>             put zlunix.filename 'zos.dataset'
>             quite
> 
> It is my understanding on zlinux .netrc I merely say ftp
> mymachine.comp.com and it should connect and login with the userid and
> password in the .netrc file then prompt for the macro (macdef) to run.
> However what I get is a prompt from the zOS FTP client to login, and
> it indicates a default userid if my zLinux id.
>   
> What have I missed with the .netrc setup?
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN

-- 
John McKown
Maranatha! <><

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to