send command over ssh - Linux
By Lucy
at 2010-02-10T07:47
at 2010-02-10T07:47
Table of Contents
※ 引述《virtuemood (小毛)》之銘言:
: 就是會有用到 bash script 送指令到遠端的需求
: 可是似乎不是很方便
: 我現在是用 expact 來寫
: 但是和 bash script 寫在一起的時後很麻煩
: 要除錯也不方便
: 有沒有一種指令可以這樣玩的
: 如:
: send "command" user@host
: 然後等遠端跑玩這行指令後再執行下一行
ssh username@host "command"
我常用這個來比較手上和遠程的檔案:
diff Makefile <(ssh username@host "cat ${PWD}/Makefile")
省下先用scp把遠方檔案拉過來。
--
In heaven, all the interesting people are missing.
--
: 就是會有用到 bash script 送指令到遠端的需求
: 可是似乎不是很方便
: 我現在是用 expact 來寫
: 但是和 bash script 寫在一起的時後很麻煩
: 要除錯也不方便
: 有沒有一種指令可以這樣玩的
: 如:
: send "command" user@host
: 然後等遠端跑玩這行指令後再執行下一行
ssh username@host "command"
我常用這個來比較手上和遠程的檔案:
diff Makefile <(ssh username@host "cat ${PWD}/Makefile")
省下先用scp把遠方檔案拉過來。
--
In heaven, all the interesting people are missing.
--
Tags:
Linux
All Comments
Related Posts
sed取代問題
By Damian
at 2010-02-09T22:41
at 2010-02-09T22:41
awk可以給範圍嗎?
By Noah
at 2010-02-09T20:58
at 2010-02-09T20:58
磁碟問題
By Kristin
at 2010-02-09T20:31
at 2010-02-09T20:31
請問Ubuntu與CIC軟體的支援度
By Oscar
at 2010-02-09T19:55
at 2010-02-09T19:55
amsn新增聯絡人
By Dinah
at 2010-02-09T19:18
at 2010-02-09T19:18