The .netrc file exists in the user's home directory and should have permissions of 0600.
The content of the file is:
Quote:
machine 192.168.100.1 login userid password userpass
machine domain.com login userid password userpass
No DNS resolution is done, so the host name on the ftp command line must match the machine name in the .netrc file.
Simplify your script; instead of trying to write the universal solution, put literals into it until you get it to work, get rid of the function, and write an inline solution.
Use building blocks. Get the ftp portion itself to work without any looping, and any variable substitution. Add variables one variable at a time.