
Это работает нормально, но не загружает мой ~/.bash_profile
сервер 2. Почему?
$ ssh -A -t server1 ssh -A -t server2 bash -c "screen -dR"
решение1
Со bash
man
страницы:
When an interactive shell that is not a login shell is started, bash
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
these files exist. This may be inhibited by using the --norc option.
The --rcfile file option will force bash to read and execute commands
from file instead of /etc/bash.bashrc and ~/.bashrc.
Вы либо повторно подключаетесь к существующему сеансу в запущенном screen
(возможно, с уже запущенным bash
), который не требует оболочки входа. Либо вы создаете новый screen
сеанс с новой интерактивной оболочкой без входа. Только оболочки входа обрабатывают .bash_profile
.
Указание bash
в командной строке для запуска screen
команды — это совершенно другой вызов.