Search notes:

~/.netrc

~/.netrc is used by the command line ftp tool (and lftp) to automatically login or execute commands.
Permission of ~/.netrc should only be readable for owner, otherwise ftp will complain
Error - .netrc file not correct permissions.
Remove password or correct mode (should be 600).

macdef

macdef MacroName defines a macro. The macro can be called in the ftp client by prepending its name with a $ sign:
$ MacroName
Macros must be terminated with an empty line.
Macros apply to the most recent machine statement seen.

Example .netrc

machine  ftp.foobar.baz
login    john
password 5ecr3t

macdef   getmyfile       # define a macro (here named 'getmyfile')
cd /abc/defghi/jklm      # The macro can be executed in ftp client
get myFile.txt           # by prepending macro name with $ sign
quit

macdef   init            # macro init is searched for when
binary                   # ftp connects to server.

machine  other.server.org
login    fred
password sunshine4ever

See also

Libraries to read and parse the ~/.netrc file include
Perl module Net::FTP: logging in with Net::Netrc

Index