Shell Script: Check If Weekend

I have some shell scripts that will perform certain actions only on a weekend (Saturday or Sunday). There are two ways to solve the “is it a weekend” logic.

The script can be scheduled via a cron job and under the cron entry, the “day of week” field must be specified as “0,6” (0 is Sunday, 6 is Saturday). On Linux, both 0 and 7 indicate Sunday.

The above crontab entry will run the script every weekend at 8am.

The other method is to add some logic in the script to determine if the current day is a weekend.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }