#!/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
命令 目錄地址
#!/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
命令 目錄地址