Linux 技術手札

Shell Script 檢查檔案及目錄是否存在

在 Shell Script 檢查檔案及目錄是否存跟 Perl 很相似, 都是透過 -e 及 -d 在 if 裡面判斷, 寫法如下:

檢查目錄是否存在

檢查檔案是否存在

Exit mobile version