[問題] 遠端執行ssh

看板Linux作者 (不可說不可說)時間15年前 (2010/10/29 13:50), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/2 (看更多)
我想直接由ssh取回遠端電腦上的一些當天剛產生當天的資料 ssh hardcover@remote_site ~/mytool -r '$(ls -l | tail -n1 | cut -c50-)' \ > my_data.txt 如果在 互動模式下就沒有沒問題,但在shell script下就會出錯。 出錯的是 '$(ls -l ......)' 這行。這行的目的是取得最新檔案的檔名。 thanks -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.69.230.190

10/29 14:05, , 1F
shell script working dir在哪裡?
10/29 14:05, 1F
文章代碼(AID): #1Coc2a5x (Linux)
文章代碼(AID): #1Coc2a5x (Linux)