:::| 目前位置圖示目前位置:首頁圖示回首頁 | 主功能頁圖示相關問答
Shell Script檢查檔案及目錄是否存在

[日期]:2018/06/28  [瀏覽人數]:364

#!/bin/sh

if [-d "/backups"]; then

    echo "Directory /backups exists"

else

    echo "Directory /backups does not exists"

fi

若要檢查檔案是否存在則-d改為-f