bash笔记:天级别的时间段
脚本:
[plain]
#!/bin/bash
tstart=$1" 00:00:00"
tend=$2
time=$1
while [ "$time" \< "$tend" -o "$time" = "$tend"]
do
echo $time
tmp=$time" 00:00:00" www.zzzyk.com
time=`date -d"+1 day $tmp" +%Y-%m-%d`;
done
命令:
sh test.sh 2012-10-27 2012-11-02
输出:
2012-10-27
2012-10-28
2012-10-29
2012-10-30
2012-10-31
2012-11-01
2012-11-02
补充:综合编程 , 其他综合 ,