小弟在寫shell時會產生一些檔案
可是因為比對的關係,有些檔案會是空檔
於是小弟想再額外寫一段shell去刪除空檔
以下是我的程式段
執行後並不會刪除除空檔,想請教正確的寫法
# if file is null then delete
test -s $homedir/log_not_upload > /dev/null
if [ $? -eq 0 ]; then
rm $homedir/log_not_upload
fi
想請教該怎麼改才會刪除檔案
感謝
--
We must not confuse dissent with disloyalty!!
--
可是因為比對的關係,有些檔案會是空檔
於是小弟想再額外寫一段shell去刪除空檔
以下是我的程式段
執行後並不會刪除除空檔,想請教正確的寫法
# if file is null then delete
test -s $homedir/log_not_upload > /dev/null
if [ $? -eq 0 ]; then
rm $homedir/log_not_upload
fi
想請教該怎麼改才會刪除檔案
感謝
--
We must not confuse dissent with disloyalty!!
--
All Comments