Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
複数のリモート サーバーにログインし、各サーバーでスクリプトを実行するスクリプトを作成しようとしています。ただし、変数をssh経由で渡したいと思います。このようなもの:
var="/home/dir/" ssh -T $mchname <<'ENDSSH' $var"run_script" < input > output & ENDSSH
この単純な試行は機能しません ($var は単に null です)。正しい構文は何でしょうか? 前もって感謝します。
前後の引用符を削除しますENDSSH。それらは、ヒア ドキュメント内の変数の展開を防ぎます。
ENDSSH