创建指定目录里所有的子目录

#########################################################################
# File Name: mkDirList.sh
# Author: 
# mail: vip_13031075266@163.com
# Created Time: 2021年02月04日 星期四 22时48分27秒
#########################################################################
#!/bin/bash

if [ $# -ne 1 ]
then
        echo "Usage: $0 directory"
        exit
fi

DIRECTORY=$1

if [ -e dirTmp.log ]
then
        rm dirTmp.log -rf
fi

find $DIRECTORY -type d > dirTmp.log

while read DIR
do
        echo "$DIR"
        mkdir -p "./$DIR"
done < dirTmp.log


 

posted @ 2021-02-04 23:09  叨陪鲤  阅读(57)  评论(0编辑  收藏  举报