📌  相关文章
📜  如果目录存在,则使用 linux 命令 - Shell-Bash 代码示例

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

代码示例1
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