DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS

OSXFAQ Daily Unix Tricks   back to index

Week 41 - Scheduling 2 (21 April 2003)

by Adrian Mayo - Senior Editor for Mac OS X Unix

Friday - The Unix Calendar

Use the 'calendar' command to query appointments and events. Create a plain text file (default name 'calendar') containing a month, date, and event on each line.

% cat calendar

10 April Thursday's job
20 April Sunday's job
26 April Saturday's job

04/01 April Fool
04/20 Sunday's job
04/29 Dentist

Print the events for a given date (specified as MMDD) with the following commands:

% calendar -d 0410
10 April Thursday's job

% calendar -d 0429
04/29 Dentist

For today (20 April in this example), you can miss out the date specification:

% calendar
20 April Sunday's job
04/20 Sunday's job

If the file is other than 'calendar' in the current directory use the '-f' option:

% calendar -f /path/name/file-name -d 0429
04/29 Dentist

Unix has some pre-written calendar files in:

/usr/share/calendar

For example:

% calendar -f /usr/share/calendar/calendar.holiday -d 0421
04/21   San Jacinto Day in Texas
04/22   Arbor Day in Nebraska & Delaware
04/22   Oklahoma Day in Oklahoma
04/21   Tiradentes in Brazil

Discuss this trick in the Learning Center forum


If you want to learn more about Mac OS X Unix visit the Learning Center  click.

  • For beginners: the Mac OS X Unix Tutorial
  • For detailed information on specific topics: Mac OS X Advanced Unix
  • For answers to common problems: Mac OS X How To



Copyright © 2000-2009 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.