rsync
is a non-interactive program that logs into other machines. It shouldn't need the init file for an interactive shell session, and it should absolutely need the init file for a login shell. Or so I would think.
Yet .bashrc
gets read and .profile
does not (unless I make .bashrc
itself read .profile
). Why?
Best Answer
rsync
itself does not read your~/.bashrc
. But it callsssh targethost rsync ...
, which will connect to ansshd
, which in turn will start your shell (bash
).Why that
bash
now reads your~/.bashrc
is explained in Why does my .bashrc get read when I run noninteractive commands over ssh