Calendar Programs

Mr. Stutz introduces us to a digital method for keeping track of appointments and those important dates in our lives.
Automating Calendar

You can run calendar whenever you like, but it might be more useful to put it in your profile file (~/.bash_profile if you use the bash shell). Then calendar will run each time you log in to the system.

I keep my personal calendar file in the doc/etc/ subdirectory of my home directory, so I would include the following line in my profile:

cd /home/m/doc/etc/; calendar; cd

Putting the same line in your .bashrc file (again, only if you use the bash shell—others are different) also works to run calendar each time you start a shell.

Sometimes even this isn't enough—if your machine is on all the time and you haven't been starting any new shells or xterms, you might miss a reminder. So you could schedule a cron job to run calendar each day, e-mailing the output to you as a reminder.

Using cal

The cal program displays a text calendar. If you call it without any options by typing:

cal

the current month will be displayed on the terminal like this (assuming September, 1998):

  September 1998
 S  M Tu  W Th  F  S
       1  2  3  4  5
 6  7  8  9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
It's pretty no-frills, but can work on any terminal. To get a calendar of the whole year, call cal with the year as argument.
cal 1950
Typing:
cal -y
will print a calendar for the current year.

cal can also display any arbitrary month. If you want to see the month of December 1999, for instance, use:

cal 12 1999

in which case you'll see:

December 1999
 S  M Tu  W Th  F  S
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Other Calendar Programs

While cal is quite useful for creating simple calendars, sometimes when printing you might want a nicer output. pcal is a program that creates very nice calendars in PostScript. Its options are very similar to that of cal. It is available from http://garbo.uwasa.fi/unix/pcal.html.

Other programs that handle calendar functions in a more graphically-intense way (and can be used only in X) include ical, at http://www.research.digital.com/SRC/personal/Sanjay_Ghemawat/ical/home.html and plan, found at http://www.in-berlin.de/User/bitrot/plan.html. There are many variants of the basic UNIX calendar programs—check the Linux Software Map for more.

With this overview of the power and flexibility of these simple calendar programs, you too can leave your analog calendar systems behind.

Michael Stutz is a writer whose first novel, Sunclipse, is freely distributed under GNU GPL copyleft—just like Linux—and is on the Web at http://dsl.org/m/doc/lit/sunclipse.html. He can be reached via e-mail at stutz@dsl.org.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState