View Single Post
Posts: 12 | Thanked: 16 times | Joined on May 2010 @ Sweden
#460
Originally Posted by thp View Post
If by "nameday" you mean something like this:

http://stjarnhimlen.se/ndag/ndag2001.html

Then you could start by transforming that page into a text file (one day per line) in a way that you can parse by a script and then write a small shell script that greps the right day out of it, e.g.:

Code:
~ $ cat nameday.txt 
01.01. Nyårsdagen
02.01. Svea
...
08.01. Erland
...
~ $ awk "/^$(date +%d.%m.)/ { print "'$2'" }" nameday.txt
Erland
So the "nameday.txt" contains the names on each line (DD.MM. NAME), and the awk command gets today's name based on that. I've added a script to billboard-scripts, but you will have to write (copy'n'paste or process) your nameday.txt yourself
Looks nice and simple, will try it, thanks !