[root@localhost sh]# cat if07-JudgeStrV2.sh
#!/bin/bash
#
#********************************************************************
#Author: jin
#QQ: xxxxxxxxxxx@163.com
#Date: 2024-03-21 20:46:47
#FileName: if07-JudgeStrV2.sh
#URL: https://blog.csdn.net/cnluxiansheng?spm=1000.2115.3001.5343
#Description: For personal learning Bash
#Copyright (C): 2024 All rights reserved
#********************************************************************
mkdir='/data/scripts/shell'
if [ -d "${mkdir}" ]; then
/usr/bin/echo " {mkdir} is exits "
exit
else
/usr/bin/mkdir -pv {mkdir}
[ -d ${mydir} ] && echo "${mydir} is exits!!!"
echo $?
exit 3
fi