
~/.bash_profile
이것은 잘 작동하지만 server2에서는 로드되지 않습니다 . 왜?
$ 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
완전히 다른 호출입니다.