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 閱讀(386) 評論(0)  編輯  收藏 所屬分類: LINUXLINUX-SHELL

          主站蜘蛛池模板: 宿迁市| 樟树市| 武隆县| 罗田县| 霞浦县| 吴忠市| 泾阳县| 沙湾县| 秦皇岛市| 沙河市| 郸城县| 比如县| 大埔区| 宁河县| 枞阳县| 崇仁县| 大庆市| 扎鲁特旗| 阳泉市| 罗甸县| 漳州市| 山丹县| 祁门县| 游戏| 镇宁| 谷城县| 棋牌| 吉水县| 民乐县| 安顺市| 辽宁省| 柳州市| 宝清县| 双桥区| 噶尔县| 曲麻莱县| 石台县| 涟水县| 象山县| 嘉祥县| 苍山县|