[Nottingham] Commandline gems and anachronisms

Martin martin at ml1.co.uk
Sun Jun 17 15:38:53 UTC 2012


Folks,

For the dates challenged amongst us, I've just rediscovered such as:

$ cal
      June 2012
Mo Tu We Th Fr Sa Su
             1  2  3
 4  5  6  7  8  9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30

And a neat trick with date:

$ date -R --date='now + 75 days'
Fri, 31 Aug 2012 16:27:37 +0100

Which are both nicely useful.


Then there is the tremendous piece of work called gcal...

$ gcal

      June 2012
 Su Mo Tu We Th Fr Sa
                 1  2
  3  4  5  6  7  8  9
 10 11 12 13 14 15 16
 17 18 19 20 21 22 23
 24 25 26 27 28 29 30

$ gcal -n --astronomical-holidays | grep Sol

Solar Eclipse/Annular 23:52 (Ast)     - Sun,  20th May 2012 =  -28 days
Solstice Day 23:08 (Ast)              - Wed,  20th Jun 2012 =   +3 days
Solar Eclipse/Total 22:11 (Ast)       - Tue,  13th Nov 2012 = +149 days
Solstice Day 11:11 (Ast)              - Fri,  21st Dec 2012 = +187 days


$ gcal --resource-file=$HOME/.gcal/astronomical -H no -ox

Sun,  17th Jun 2012:            @@           )
                           @@                     )
                         @                          )
                       @                              )
                      @                                )
                     @                                  )
                     @                                  )
                      @                                )
                       @                              )
                        @                            )
                           @                      )
                               @              )
                     Moon phase 7%-
                     Sunrise is at 05:23
                     Sunset is at 22:17

See:

http://www.basicallytech.com/blog/index.php?/archives/97-The-many-uses-of-gcal.html#astronomical

for more on that one.

However, to make full use of gcal is bewildering!


Anyhow:

cal is old, tried, tested, and simple to use;

"date -R --date='...'" nicely did the job on this occasion. I'm nicely
impressed with the 'free-form' --date option;

gcal is nicely OTT and a stupendous piece of work, but unfortunately far
too obscurely so to be easily used. Wikipedia was far easier for finding
the exact Solstice time for this year...


Any other fun quirky commandline gems out there?

Cheers,
Martin

-- 
- ------------------ - ----------------------------------------
-    Martin Lomas    - OpenPGP (GPG/PGP) Public Key: 0xCEE1D3B7
- martin @ ml1 co uk - Import from   hkp://subkeys.pgp.net   or
- ------------------ - http:// ml1 .co .uk/martin_ml1_co_uk.gpg



More information about the Nottingham mailing list