参考:
基本例子https://blog.csdn.net/huplion/article/details/80027419
dirname=$1 if [ ! -d ${dirname} ]; then mkdir ${dirname} else echo dir exists fi
注意:1.在windows下编辑的,需要vim中设置 :set fileformat=unix才能用,2.定义变量等号左右不要有空格!
参考:
基本例子https://blog.csdn.net/huplion/article/details/80027419
dirname=$1 if [ ! -d ${dirname} ]; then mkdir ${dirname} else echo dir exists fi
注意:1.在windows下编辑的,需要vim中设置 :set fileformat=unix才能用,2.定义变量等号左右不要有空格!