
これは正常に動作しますが、サーバー 2 にロードされません~/.bash_profile
。なぜでしょうか?
$ 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
、まったく別の呼び出しです。