Command-line hacking: calculating the phase of the Moon

from blog Kevin Boone's website, | ↗ original
How to use Bash shell arithmetic, along with the 'date' utilty, to calculate the phase of the Moon on a particlar day.