2009年10月22日 星期四

shell 引號範例

不錯的範例
http://cha.homeip.net/blog/archives/lccnotes.txt

練習:
執行 date 程式會顯示日期時間, 試問下列結果為何?
1) touch "date" ==> 建立 date 檔案
2) touch 'date' ==> 建立 date 檔案
3) touch `date` ==> 建立 星期, 日, 月, 年, 時間... 等6個檔案
4) touch $(date) ==> 同上
5) touch "`date`" ==> 建立一個以目前時間為檔名的檔案
6) touch "'date'" ==> 建立 'date' 檔案
7) touch '"date"' ==> 建立 "date" 檔案
8) touch '$(date)' ==> 建立 $(date) 檔案
9) touch "$(date)" ==> 建立一個以目前時間為檔名的檔案

沒有留言:

張貼留言

BloggerAds