2013-04-02, 10:28pm
Below is my feeble attempt to convert the moon-phase Ruby script into Bash.
Unfortunately, this doesn't work for two reasons:
- I don't know shell scripting very well.
- Bash arithmetic can't handle anything other than integers.
There is a chance that cal() or date() could handle some of this, but I don't understand either of them well enough. I also have a suspicion that the way I'm using 'Julian' in this code is an inaccurate descriptor of what's being calculated. I should have read up on moon phase calculating or read through the source of the other libraries around GitHub that are doing this, but I was rushing to make this a fast, fun thing so I didn't get mired in the literature like I want to now.
In any case, here's as far as I got before giving up for the night.