在 Cygwin 环境下使用 linux 命令(2)

1. 判断文件夹是否存在

当 sub 文件夹不存在的时候,新建 sub 文件夹。

FOLDER_PATH="f:/test/sub"

if[ ! -d "$FOLDER_PATH" ]; then

  echo "not found the folder. so create the folder."

  mkdir "$FOLDER_PATH"

fi

编程之美。
原文地址:https://www.cnblogs.com/LuQingshang/p/5775783.html