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

We recently needed a shell script to block activity during a given time window. I found — 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.



Software developer and writer of words, see for more details.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store