Blinking snake

Ncal

NAME

ncal - print calendar

SYNTAX

ncal [-h?MdmnyC] <month> <year>

DESCRIPTION

Ncal is cal, modified to accept reasonable arguments and to exhibit reasonable behaviour. Ncal prints a calendar for a specified year, which can be between 1 and 999999. Ncal can also print a calendar for a specified month of a year. No longer will it chew off your hand when you have the temerity to ask for a calendar page for “January” instead of “1”.

Most changes result in ncal acting like the shell-script version of cal in Kernighan & Pike’s The Unix Programming Environment. Ncal allows you to get away from the overhead of using a shell script, and adds new arguments to make it talk to other programs without mumbling.

OPTIONS

-h or -?
Print a short help message and die.
-M
Print this manual page and die.
-d<##>
Set the day of the month to be highlighted to <##>; this is only effective with the -n option.
-m<##>
Set the month for which a calendar page is prepared to be <##>; the -d, -m and -y arguments must be numeric (just like old cal).
-n
Emit output to be piped into bxy, a (local) box-drawing program, that encodes the days of the month, the number of days in the month, the day of the week the month begins on, and a highlighting code for the day of the month (either the current day or one requested by the -d option). Used by boxdate (another local command), ncal and bxy draw a calendar page for the current month on the terminal screen.
-y<##>
Set the year for which a calendar page is prepared to be <##>.
-C<##>
Set the Changeover year to be <##>; this is the year in which the Gregorian calendar replaced the Julian calendar. In most parts of the world, this year was 1582, as mandated by (who else?) Pope Gregory XIII; almost all Catholic countries adopted the new style calendar immediately. Non-catholic countries, however, took a little longer (they weren’t about to let a bunch of papists take 10 days away from them), and therefore waited until they were pretty much forced to adopt the revised calendar. In Britain and her colonies, the year of the Changeover was 1752, and caused the month of September of that year to only contain 19 days. (An aside: at the same time, by Act of Parliament in 1751, the beginning of the year was changed from March 25 to January 1, effective 1752. The Romans had already done this by 8 CE, and they’re the ones who originally started the year on March 25; this says something about British conservatism, I believe.) Other Changeover dates ranged up to 1867 (Alaska), 1918 (U. S. S. R.) and 1927 (Turkey). I have only set ncal up to know about 1582 and 1752 just now, but plan to add as many other Changeover dates as I can as time permits.
month
A number from 1 to 12 is used to specify the desired month. The name of the month is also acceptable; you may specify “Jan”, “jan”, “January” or “january” instead of the month-number “1” if you wish. The month name supplied by date is sufficient. Also, if you specify ncal 1, ncal will assume you wish a calendar for the month of January, in the current year, and NOT hand you the full year 1 CE. To obtain a calendar for the year 1 CE, use the -y option.
year
Specifies a year between 1 and 999999. (Note: these limits are silly, and will be removed soon.)
default
Ncal produces a calendar page for the current month of the current year (amazingly sensible, right?).

EXAMPLES

$ ncal 1492



				1492

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

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

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



$ ncal 3 1950  (or, ncal mar 1950)
    March, 1950
 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

$ ncal
   August 1987
 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
$ ncal 1752



				1752

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

	 Apr			May		       Jun
 S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
          1  2  3  4                   1  2       1  2  3  4  5  6
 5  6  7  8  9 10 11    3  4  5  6  7  8  9    7  8  9 10 11 12 13
12 13 14 15 16 17 18   10 11 12 13 14 15 16   14 15 16 17 18 19 20
19 20 21 22 23 24 25   17 18 19 20 21 22 23   21 22 23 24 25 26 27
26 27 28 29 30         24 25 26 27 28 29 30   28 29 30
                       31
	 Jul			Aug		       Sep
 S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
          1  2  3  4                      1          1  2 14 15 16
 5  6  7  8  9 10 11    2  3  4  5  6  7  8   17 18 19 20 21 22 23
12 13 14 15 16 17 18    9 10 11 12 13 14 15   24 25 26 27 28 29 30
19 20 21 22 23 24 25   16 17 18 19 20 21 22
26 27 28 29 30 31      23 24 25 26 27 28 29
                       30 31
	 Oct			Nov		       Dec
 S  M Tu  W Th  F  S    S  M Tu  W Th  F  S    S  M Tu  W Th  F  S
 1  2  3  4  5  6  7             1  2  3  4                   1  2
 8  9 10 11 12 13 14    5  6  7  8  9 10 11    3  4  5  6  7  8  9
15 16 17 18 19 20 21   12 13 14 15 16 17 18   10 11 12 13 14 15 16
22 23 24 25 26 27 28   19 20 21 22 23 24 25   17 18 19 20 21 22 23
29 30 31               26 27 28 29 30         24 25 26 27 28 29 30
                                              31


$

BUGS & SPECIAL CONSIDERATIONS

When specifying the year, the entire number must be used (e.g., 1983 or 1776).

SEE ALSO

cal(1), date(1), bxy(L), boxdate(L), grj(L), jug(L)

PLATFORMS SUPPORTED

UnixWare®

AUTHOR

Original author unknown; modified by Ivan Van Laningham (June, 1987).
If you would like the C source, email me.

Previous Page
Table of Contents
Next Page

Main web site:  http://www.pauahtun.org

Valid HTML 4.01 Transitional