[svlug] Calcurse Mail Reminder

Scott DuBois rhcom.linux at gmail.com
Sun Jan 18 16:53:34 PST 2015

So I've been working with this program Calcurse which is a console based
calendaring/scheduling program. It's cool but, I wanted it to send me reminders
either by email or text so I wrote a bash script to do that.

The bash script reads the message file and compares the current date to the
dates listed in the file so that it only mails the appointments for the
particular day. It then checks to see if there are any associated notes with the
appointment and sends those as well.

Works good for a daily cron to email. Text messaging I'm not sure but, if
someone wants to try and figure that out - that would be cool.

# Script starts below this line ----------------------------

# Calcurse email reminders
# Verifies date association and
# includes any related notes
# Sun Jan 18 16:39:43 PST 2015
# Written by: Scott DuBois

#file location to appointments

#file location to notes

#date results to variable
mdy=$(date +%m/%d/%Y)

# verify file exists
if [ -f $mssg ]; then

 #read each line from file separately
 while read -r line



    #check to see if dates match
    today=$(echo $appts | grep $mdy)

     if [ "$today" != '' ]; then 

      #print date relative messages
      echo $today
      printf "\n"

       #check to see if notes exist 
       if [[ "$today" =~ '>'[^' '] ]]; then

        #extract uniqe note ID
        uniqID=$(echo $today | cut --delimiter=' ' --fields=8 | tr -d '>')

          #retrieve notes by ID and append
          getNote=$(cat $notes/$uniqID)
          printf "Appt. Notes...\n"
          echo $getNote
          printf "\n"


 done < $mssg


   printf "Nothing Today\n"


# script ends above this line -----------------------------



EFF ID: 1731778

"The difference between stupidity and genius is that genius has limits."
-- Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
Url : http://lists.svlug.org/archives/svlug/attachments/20150118/6c8c3cf4/attachment.bin

More information about the svlug mailing list