Member-only story
Shell-Script: Test Whether The Current Time Is Within The Desired Time Window
A Simple Script That Checks If The Current Time Is Inside Or Outside Of The Given Hours
Jan 23, 2023
We recently needed a shell script to block activity during a given time window. I found a helpful stackexchange solution — but it needed a bit of tweaking to make it Bourne-shell friendly (and handle time windows) so I’m publishing my solution here in an attempt to make it more easily searchable.