cal (Unix)

from Wikipedia, the free encyclopedia

cal is a standard program under UNIX and UNIX-like operating systems thatoutputsa calendar on the standard output channel. Its range of functions and its behavior is defined by the POSIX standard.

history

cal is one of the oldest Unix programs. It was already available in the very first AT&T UNIX Version 1 (on the PDP-7 ).

behavior

The POSIX standard provides - in addition to the usual input and output behavior for command line programs - that for data between January 1 of the year 1 and September 2 of the year 1752 the Julian , from September 14, 1752 to December 31, 9999 however, the Gregorian calendar is issued. In particular, the month of the changeover - September 1752, which corresponds to the calendar reform in the Anglo-Saxon countries - provides the output ( AIX 7.1.3 SP3, LANG = C):

# cal 9 1752
      September 1752
Sun Mon Tue Wed Thu Fri Sat
         1   2  14  15  16
17  18  19  20  21  22  23
24  25  26  27  28  29  30

The behavior of cal is not specified for data from date or from January 1, 10000 . Its functionality is influenced by locale variables as well as the set time zone (environment variable TZ ).

cal expressly uses four-digit years. The command " cal 99 " delivers neither the calendar for 1999 nor for 2099, but the one for 99 and 2099. Z.

Individual evidence

  1. a b cal specification of the Open Group. Retrieved June 24, 2014 .