遠端執行ssh - Linux

Table of Contents

我想直接由ssh取回遠端電腦上的一些當天剛產生當天的資料

ssh hardcover@remote_site ~/mytool -r '$(ls -l | tail -n1 | cut -c50-)' \
> my_data.txt

如果在 互動模式下就沒有沒問題,但在shell script下就會出錯。
出錯的是 '$(ls -l ......)' 這行。這行的目的是取得最新檔案的檔名。

thanks

--

All Comments

Emily avatarEmily2010-11-01
shell script working dir在哪裡?