Linux bash Shell directory exists check

  • 간단하게 체크할 수 있음.
#!/bin/sh

BASIC_PATH=/home/test/dic

if [ ! -d "$BASIC_PATH" ]; then
        echo "THIS BASIC PATH NOT EXIST"
        mkdir -p $BASIC_PATH
fi

Related Posts