공부
[Sh] for date `start ~ end`
승가비
2021. 1. 9. 00:51
728x90
start=20200101
end=20201231
date=$start
while [ $date -le $end ]
do
date=`date -d "$date+1 days" +%Y%m%d`
done
https://www.cyberciti.biz/faq/how-to-add-days-to-date-and-get-new-date-on-linux/
How to add days to date and get new date on Linux - nixCraft
Explains how to add or subtract days using date command calculation on Linux, Unix, and macOS/*BSD operating system command line.
www.cyberciti.biz
728x90