LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Print Subscribe to Linux Subscribe to Newsletters
Linux & Unix > Excerpts >
Living Linux

Managing Appointments

06/06/2000

The subject of this week's column is how to manage your appointments using a simple reminder service, the calendar tool.

It reportedly first appeared in Version 7 of AT&T Unix, and was rewritten early on for the BSD family of Unix. The BSD derivate is available for Debian as part of the bsdmainutils package, but this tool isn't yet standard on all Linux distributions (including Red Hat). If your distribution doesn't have it, you can obtain the source package from Debian.

What it does

When calendar executes, it reads a "calendar file" in the current directory which contains a list of appointments and reminders, and it outputs those entries in the file for today or tomorrow's date. (On a Friday, it outputs entries for that weekend and for the following Monday.)

For example, if today is Friday, June 16, and you run calendar in the same directory as your calendar file, typical output might look like this:

$ calendar RET
6/16	Finish draft of presentation!
	Rob's party
Fri	Lunch with Kim and Jo
Mon	Presentation to staff, 1pm
$

Format of the calendar input file

To begin using calendar, you need to make a "calendar file" where you can enter your appointments. It's just a plain text file, and can be called either calendar or .calendar (the latter makes it a "hidden" file).

Write each appointment or calendar entry on a line by itself (blank lines in the file are ignored). Entries are formatted like this:

[date][tab or other whitespace][text of reminder itself]

Just about every common date style is recognized. For example, the following are all valid dates for the Fourth of July:

7/4
July 4
4 July
Jul. 4
Jul 4

Entries aren't constrained to a single day, either; you can have entries for a day of the week or for a certain month -- "Mon" or "Monday" for every Monday; "Jun" or "June" for the first day of every June. You can use an asterisk as a wildcard: "*/13" reminds you of something on the thirteenth of every month. When the date is omitted on a line, the date on the preceding line is used.

For example, suppose you have a file called calendar in your home directory which contains the following:

6/16	Finish draft of presentation!
	Rob's party	
Fri	Lunch with Kim and Jo
Mon	Presentation to staff, 1pm

If the current date is 16 June, a Friday, and you run calendar in your home directory, you'll get the output shown in the first example in this column.

Note that the entry about the party does not have a date on it -- the date of the previous entry is assumed.

Pages: 1, 2

Next Pagearrow




Tagged Articles

Be the first to post this article to del.icio.us

Recommended for You

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

Sign up today to receive special discounts,
product alerts, and news from O'Reilly.
Privacy Policy >
View Sample Newsletter >
  • Youtube
  • http://www.youtube.com/OreillyMedia
  • Twitter
  • Subscribe
  • View All RSS Feeds >
O'Reilly Media

800-889-8969 or 707-827-7019
Monday-Friday 7:30am-5pm PT
©2011, O'Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
  • About O'Reilly
  • Academic Solutions
  • Contacts
  • Customer Service
  • Careers
  • Press Room
  • Privacy Policy
  • Terms of Service
  • Writing for O'Reilly
  • Community
  • Authors
  • Forums
  • Membership
  • Newsletters
  • RSS Feeds
  • User Groups
  • More O'Reilly Sites
  • igniteshow.com
  • makerfaire.com
  • makezine.com
  • craftzine.com
  • labs.oreilly.com
  • Partner Sites
  • PayPal Developer Zone
  • O'Reilly Insights on Forbes.com