September 3, 2024

Abook: Show birthdays for the next 30 days

I am trying to print the names and birth dates of people whose birthday is in the next 30 days.

I use the programme abook to store my contacts, their details, birthdays, etc.

I have not figured how to do so yet. For now, I am using this function which I added to .bashrc:

# print all birth dates and names for a given month from abook
function abb() {
    grep anniversary.*"$@"- ~/.abook/addressbook -B 7 | \
    grep 'name\|anniversary'
}

so I can run:

$ abb 09

to shows the birth dates and names of contacts whose birthday is in September.

This function is far from the desired one - but that is where I am at for now. Next I need to figure how to write a script, using awk or bash I imagine, that can show all birthdays for the next 30 days. Suggestions welcome https://yctct.com/contact


Before using the above function, I used the following (for example to show birthdays in September):

$ grep anniversary.*09- ~/.abook/addressbook -B 6 | grep 'name\|anniversary'

personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki abook offline text processing

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88