15DAYS AND DATES
It’s tricky to calculate date math, whether you’re trying to figure out if a given year was a leap year, how many days remain until Christmas, or how many days you’ve been alive. This is where there’s a chasm between the Unix-based systems, like OS X, and Linux systems with their GNU foundations. David MacKenzie’s rewrite of the date utility for the GNU version of Linux is dramatically superior in its capabilities.
If you are using OS X or another system where date --version generates an error message, you can download a set of core utilities that will give you GNU date as a new command line option (probably installing it as ...
Get Wicked Cool Shell Scripts, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.