I keep a plain text file in a personal directory with the birthdays of all my relatives
and friends in it. In order not to forget a birthday, I put together a script to query
that text file the first day of each month. Here's what it all looks like:
Okay, this is the sample text file:Let's go through the script. First off, the #!/bin/sh simply assigns the shell used.
Joe Blow: Jan 03
Mr Deeds: Feb 04
Also Knownas: Mar 09
John Doe: Apr 16
Mr Bossman: May 27
Serial Hacker: Jun 11
Kenny Kludge: Jul 22
General Disorder: Aug 14
Corporal Punishment: Sep 03
Major Disaster: Oct 26
Jack Spratt: Nov 07
Shirley Ujest: Dec 09
And this is the script:
#!/bin/sh
# Notify me if there are any birthdays each month
THISMONTH=$(date -j | cut -c 5-7)
BIRTHDAYS=$HOME/personal/birthdays.txt
if cat $BIRTHDAYS | grep -q $THISMONTH;
then
echo # make line spacing for readability
echo "There are birthdays this month!"
echo # same as above
grep $THISMONTH $BIRTHDAYS
else
echo # once again, same as above
echo "No birthdays this month!"
fi
No affiliation between this site and the OpenBSD project exists or is implied.