📌  相关文章
📜  用于检查目录是否存在的 shell 脚本 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:50.994000             🧑  作者: Mango

代码示例2
DIR="/etc/httpd/"
if [ -d "$DIR" ]; then
  ### Take action if $DIR exists ###
  echo "Installing config files in ${DIR}..."
else
  ###  Control will jump here if $DIR does NOT exists ###
  echo "Error: ${DIR} not found. Can not continue."
  exit 1
fi