Skip to content

Instantly share code, notes, and snippets.

@geunho
Created October 14, 2022 11:03
Show Gist options
  • Save geunho/f89759e1db9521aea6f9e92f18578848 to your computer and use it in GitHub Desktop.
Save geunho/f89759e1db9521aea6f9e92f18578848 to your computer and use it in GitHub Desktop.
시간을 순회하면서 처리해보자
start=20220101
end=20221014
while ! [[ $start > $end ]]; do
start=$(date -d "$start + 1 day" +%Y%m%d)
day=$(date -d "$start" +%d)
# 예시. 매월 1일은 처리 대상에서 제외
if [ $day != 01 ]; then
echo $start
## DO YOUR WORK
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment