簡體   English   中英

bash在此ssh命令中做什么?

[英]What does bash do here in this ssh command?

ssh -i host 'scripts/myScript start; bash'

shell腳本中的函數start在哪里? 在此處將bash附加到腳本有什么作用? 一點背景知識:它為我提供了一個交互式shell,並執行myScript,就像使用純ssh實際登錄到主機一樣。 如果我省略bash的話。

ssh -i host 'scripts/myScript start;'

它不會導致交互式登錄,但是會導致非交互式shell登錄,並且由於環境變量問題,myScript無法按預期運行。

尾隨bash會導致啟動的交互式會話bash在遠程主機上的命令后, scripts/myScript start回報。

另外,您需要使用-t分配偽終端:

ssh -t host 'scripts/myScript start; bash'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM