paulwong

          linux shell 中檢查文件夾是否存在

          To check if a directory exists in a shell script, you can use the following:
          if [ -d "$DIRECTORY" ]; then
            # Control will enter here if $DIRECTORY exists.
          fi

          Or to check if a directory doesn't exist:
          if [ ! -d "$DIRECTORY" ]; then
            # Control will enter here if $DIRECTORY doesn't exist.
          fi

          posted on 2020-09-25 11:11 paulwong 閱讀(384) 評(píng)論(0)  編輯  收藏 所屬分類: LINUXLINUX-SHELL

          主站蜘蛛池模板: 南靖县| 星座| 永春县| 长乐市| 铁岭县| 中卫市| 龙门县| 荥经县| 从江县| 镇沅| 肥东县| 昭平县| 陆良县| 城口县| 平顶山市| 正蓝旗| 南昌市| 吉安市| 双鸭山市| 蚌埠市| 耿马| 长沙市| 囊谦县| 彝良县| 兴和县| 临沧市| 丹东市| 新乐市| 咸宁市| 宾阳县| 新竹县| 丹凤县| 乐平市| 克东县| 仁化县| 枣强县| 鄂伦春自治旗| 镇雄县| 达孜县| 哈尔滨市| 汝南县|