Ask Dave Taylor: Tech and Business

Sunday

How do you do date math in Linux?

While modern Linux operating systems have more capabilities than you can shake a bag full of sticks at, there are still some tasks that aren't as easy as you'd like. One of the most common challenges is date math. What's the date 37 days from today, or 496 days ago? The question I received asked about solving this puzzle within a shell script, but while it's possible, it's quite a bit easier to produce a succinct C program to do the work instead:

&nbps;   Date Math in a Linux shell script?

It's always fun to write an actual compiled program after spending so darn much time writing lightweight shell scripts too.