Shell script問題請教 - Linux
By Quanna
at 2012-04-02T19:12
at 2012-04-02T19:12
Table of Contents
最近在寫一個Linux shell script.
主要是去判斷檔案資料夾是否存在,執行程式,並取得回傳值。
內容大致為:
if [ -d /home/ddd ]; then
rm -r /home/ddd/*
printf "Delete items"
else
....
printf "create folders"
fi
...
...
當我執行shell時,可以看到printf的這些資訊顯示在console上。
想請問是否有什麼指令可以"在console看到這些資訊"
並將這些資訊存入另外一個Log file?
謝謝大家的幫忙。
--
主要是去判斷檔案資料夾是否存在,執行程式,並取得回傳值。
內容大致為:
if [ -d /home/ddd ]; then
rm -r /home/ddd/*
printf "Delete items"
else
....
printf "create folders"
fi
...
...
當我執行shell時,可以看到printf的這些資訊顯示在console上。
想請問是否有什麼指令可以"在console看到這些資訊"
並將這些資訊存入另外一個Log file?
謝謝大家的幫忙。
--
Tags:
Linux
All Comments
By Valerie
at 2012-04-07T10:23
at 2012-04-07T10:23
By Ina
at 2012-04-10T19:06
at 2012-04-10T19:06
By Damian
at 2012-04-11T04:24
at 2012-04-11T04:24
By Oliver
at 2012-04-14T06:23
at 2012-04-14T06:23
Related Posts
linux下變更win7 檔案權限
By Lucy
at 2012-04-02T15:37
at 2012-04-02T15:37
請問CentOS5.8 灌在9TB的disk
By Anthony
at 2012-04-02T15:21
at 2012-04-02T15:21
shell ftp 之後再執行動作
By Heather
at 2012-04-02T11:42
at 2012-04-02T11:42
Ubuntu-關於 Alternative or Desktop
By Hardy
at 2012-04-02T00:52
at 2012-04-02T00:52
有關於空密碼的問題
By Daniel
at 2012-04-01T20:34
at 2012-04-01T20:34