For example: Statistics of submission records after 21:00 and before 5:00 am every day.
After consulting various documents and google, I used the stupidest method to achieve it:
git log --pretty=format:'%h %cn %cd %s' --date='format:%Y-%m-%d %H:%M:%S' | \
awk '{hour=0+substr(,0,2); if(hour>21 || hour<5) printf "%-10s %-15s %-12s %-10s %-10s\n", , , , , }'
But it doesn’t look elegant enough. I want to use date comparison in awk, but there are all kinds of pitfalls.
Is there a better way?
Why you must use shell+awk
php and python not working
Can use python