#!/bin/bash

if [ -e $1 ]
        then
                echo "目录存在"
        else
        {
                        echo "目录不存在,是否创建1是2否"
                        read -p "请输入1或者2:" mulu
                        if [ $mulu -eq 1 ]
                                then
                                        mkdir $1
                        elif [ $mulu -eq 2 ]
                                then
                                exit 0
                        fi
                }

fi

命令 目录地址