mkdir 创建整个月目录?

mkdir 创建整个月目录?

比如创建4月份每天一个目录
20080401 20080402 ... 20080430

不会写脚本,哪位帮写一下?

先谢了      
抛个砖
引用:
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=30020 $?=0] ; cat foo.sh
#!/bin/bash

nYear=2008
nMon=2

for ((i = 0; ; ++i)); do
    sDate="$nYear-$nMon-1 + $i day"

    newMon=$(date +%m -d "$sDate")
    if [ $nMon -ne $newMon ]; then
        break
    fi

    date +%Y%m%d -d "$sDate"
done
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=30020 $?=0] ; ./foo.sh
20080201
20080202
20080203
20080204
20080205
20080206
20080207
20080208
20080209
20080210
20080211
20080212
20080213
20080214
20080215
20080216
20080217
20080218
20080219
20080220
20080221
20080222
20080223
20080224
20080225
20080226
20080227
20080228
20080229
-(dearvoid@LinuxEden:Forum)-(~/tmp)-
[$$=30020 $?=0] ; bye
      
好强大
      
继续抛砖
充份利用cal提供的信息
复制内容到剪贴板
代码:
$ cat dayofmon.sh
#! /bin/bash

## 按年月取得yyyymmdd的天格式

export LC_ALL=C

month=$1
year=$2

[[ -z $month ]] && month=$( date | awk '{ print $3 }' )
[[ -z $year ]]  && year=$( date | awk '{ print $NF }' )
begin=$( cal $month $year | xargs -n1 | sed -n '10p'  )
end=$(   cal $month $year | xargs -n1 | sed -n '$p'   )
seq -w $begin $end | xargs -i'day' date '+%Y%m%d' -d ${year}-${month}-day


$ ./dayofmon.sh 2
20080201
20080202
20080203
20080204
20080205
20080206
20080207
20080208
20080209
20080210
20080211
20080212
20080213
20080214
20080215
20080216
20080217
20080218
20080219
20080220
20080221
20080222
20080223
20080224
20080225
20080226
20080227
20080228
20080229