Решение состоит в том, чтобы определить макрос с именем init
Извлечь из man netrc
macdef name
Define a macro. This token functions like the ftp macdef command functions.
A macro is defined with the specified name;
its contents begin with the next .netrc line and continue until a null line
(consecutive new-line characters) is encountered. If a macro named
init is defined, it is automatically executed as the last step in
the auto-login process.
Пример .netrc
с макросом init :
machine 192.168.19.5
login theusername
password theSECRETpassword
macdef init
pwd
!pwd
lcd /tmp
cd /tmp
pwd
!pwd
machine 192.168.19.6
../..