Next Business Day after 15th Bash Script

2019-09-21 20:17发布

I need bash script for next business day after 15th of the current month. It should only give me next business day after 15th. I'm totally new to Bash Script. Thanks a lot. d=1 while (($(date -d "$d days" +%u) >= 6)); do ((++d)); done date -d "$d days" +%m/%d/%Y

标签: shell
1条回答
一夜七次
2楼-- · 2019-09-21 21:05

Quick and dirty using cal: First case is Friday, then Saturday, then Sunday.

( cal | grep -q "15 16$"  && echo 18  ) || ( cal | grep -q "15$"  && echo 17  ) || (  echo 16 )
查看更多
登录 后发表回答