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

          主站蜘蛛池模板: 渭南市| 吴忠市| 威信县| 灵武市| 乌苏市| 威宁| 稻城县| 乐业县| 阿瓦提县| 资中县| 松阳县| 潮安县| 涿鹿县| 桐乡市| 谷城县| 鹤山市| 麟游县| 都江堰市| 山阳县| 阳曲县| 静安区| 富裕县| 德化县| 克什克腾旗| 洪雅县| 伊川县| 海城市| 青浦区| 玉树县| 茂名市| 逊克县| 民和| 温州市| 保亭| 烟台市| 镇远县| 南陵县| 石渠县| 永寿县| 太保市| 安徽省|