Frank's Addressbook Proogram

ab is a cute little addressbook program written in perl. It keeps track of names, addresses (both postal and electronic mail), phone numbers and birthdays. You can also use it to remind you of upcoming birthdays. It uses termcap capabilities and works on any vt100-ish type display.

Command line options

  ab [-f addressfile] [-bc]
-f allows you to specify a different file to be used as the addressbook. By default it is ~/.addresses.

-b makes it run in batch-mode in which it does not prompt you to save changes to the file until you exit. Useful for when you are first entering addresses into it (and don't want to have to save every damn time). By default it will prompt you to save changes right after you make them.

-c tells it to check for birthdays. It figures out what day it currently is and then does a pattern match for anything that matches today, tomorrow and the day after tomorrow. Since it is a pattern match it tends to pick up things like "April 30" when it's looking for "April 3." I don't consider it too annoying (lets me know what's going on for the month at the beginning as a side effect. Useful to put the line "ab -c" in your .login file.

Data Fields

ab has 7 different types of data fields it stores: Name, Primary Number, Secondary Number, Address, Birthday, Email, and Comments.

The first is the Name . This is displayed in both the detailed and summary listing. This field is checked by the search command.

The second is the Primary Number . This is displayed in both the detailed and summary listing. It is the user's choice whether this should be home or business, day or evening, etc. Because it shows up in the summary listing, it should contain the number that will be more often be used.

The third is the Secondary Number . This is displayed in the detailed listing. It is the user's choice whether this should be home or business, day or evening, etc. Because it only shows up in the detailed listing, it should contain the number that is not as often used.

The fourth is the Address . This is displayed in the detailed listing. It can contain up to three lines of text, free format.

The fifth is the Birthday. This is displayed in the detailed listing. It should contain the birthday, in whatever format is appropriate. It is checked by the search command, so the dates should correspond to the system date (i.e., Unix uses 3 letter months, so at least that should be used. Since regular expressions are used, the month name can be longer than format used by the system date). This would be legal (if there were two people in an entry: Sept. 24th, Oct. 24th).

The sixth is the Birthday. This is displayed in the detailed listing. It is free format.

The seventh is the Comment. This is displayed in the detailed listing. It holds 3 lines of free format comments. Useful if you need to remind yourself exactly who the person is.

Commands For Running ab

When you start the screen is divided into two halves. The top part is the detailed listing of the current entry, while the bottom part is the summary of the near entries. Note that the addressbook does not enforce alphabetical order. I decided I wanted to put long-distance and local separate, and keep certain people next to each other even if it violates alphabetic order (e.g., married couple where each has a different last name).

Moving Around

ab supports a combination of emacs and vi style motion.
j,^N, down arrow
scroll down one line
k, ^P, up arrow
scroll up one line
scroll down one page
scroll up one page
Note that these functions only affect the summary listing, not the detailed listing. Refer to the next section on how to update the detailed listing. At this time there is no way to go to the bottom or top of the buffer.

Updating the Display

<ENTER> or <RETURN> key
Pressing this key causes the detailed listing to be updated. Since the detailed listing does not get updated during single line scrolling, this is the easiest way to update it.
Pressing control-L redraws the entire screen, updating the display if necessary. Useful if there's line noise or similar.

Adding an Entry

Displays a blank entry in the detailed listing and allows the user to enter all of the fields. Hitting a <Return> leaves that field blank. After all the fields are entered, ab prompts the user to indicate if the entry should be added before or after the current entry, or if the user wants to quit adding an entry and discard the attempt. If not in batchmode , ab prompts the user to save.

Deleting an Entry

deletes the current entry (where the cursor is in the summary list). Prompts to confirm deleting this entry.

Editing an Entry

Allows the user to change the fields for an entry. Simply hit <return> until the proper line is highlighted. The entire field must be entered (line editing of a field is not supported). After all the fields have been retyped or skipped, ab prompts the user to confirm the changes and then to save them (if not in batchmode ).

Moving an Entry

ab does not allow entries to be moved around in the file. This is the one function it could really use.


/ [searchterm]
The / command searches the Name and Birthday fields for the specied search term. If the searchterm is ommitted, then the searchterm from the last search command is used. The search starts from the current line to the end of the file, and then wraps fromt he top of the file to the current line. Regular expressions are legal.

Saving the Data

There is no command to explicitly save the data. This is done immediately after an entry is added or edited (unless ab is running in batchmode ) and when the quit command is selected.


quits the program. Prompts to save data file if modified.

Where To Get ab

Just follow this link to get it. You may have to change to first line to point to where ever you have Perl installed.


If you like it, hate it, things it's useful, stupid or cool, feel free to drop me a note and let me know. As I'm frantically working on my dissertation at the moment, I don't think I'll be doing any work on it for a while, but at some point I might. Last minor update was to support the Term::Cap library instead of the old module. Current home is: And I did finish my dissertation (back in '95).
Created 4/2/95 by FNA
Modified 4/5/96 by FNA
Modified 4/29/02 by FNA
Last Modified 5/25/11 by FNA