一、判断文件夹是否存在,不存在则创建
#!/bin/bash
FOLDER_URL="/Users/bestfei/Documents/fei/shell/filetxt"
echo "FOLDER_URL is ${FOLDER_URL}"
# -d 参数判断 $file 是否存在
if [ ! -d ${FOLDER_URL} ]
then
echo 'folder not exist,begin to create'
mkdir ${FOLDER_URL}
else
echo "folder \"${FOLDER_URL}\" exist"
fi