Template:Lowercase title {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other <syntaxhighlight lang="text" class="" style="" inline="1">cal</syntaxhighlight> is a command-line utility on a number of computer operating systems including Unix, Plan 9, Inferno and Unix-like operating systems such as Linux that prints an ASCII calendar of the given month or year. If the user does not specify any command-line options, cal will print a calendar of the current month. The command is a standard program on Unix and specified in the Single UNIX Specification.

ImplementationsEdit

The cal command was present in 1st Edition Unix. A cal command is also part of ASCII's MSX-DOS2 Tools for MSX-DOS version 2.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> It is also available for FreeDOS. This implementation only supports the Gregorian calendar (New Style) and may be distributed freely, with or without source. The FreeDOS version was developed by Charles Dye.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

ExamplesEdit

<syntaxhighlight lang="console"> $ cal

   February 2024                   
Su Mo Tu We Th Fr Sa
             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

</syntaxhighlight>

<syntaxhighlight lang="console"> $ cal -3 (shows the previous, current and next month)

    June 2022             July 2022            August 2022       

Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa

         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 </syntaxhighlight>

<syntaxhighlight lang="console"> $ cal 2023

                           2023
     January               February               March          

Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa

1  2  3  4  5  6  7            1  2  3  4            1  2  3  4  
8  9 10 11 12 13 14   5  6  7  8  9 10 11   5  6  7  8  9 10 11  

15 16 17 18 19 20 21 12 13 14 15 16 17 18 12 13 14 15 16 17 18 22 23 24 25 26 27 28 19 20 21 22 23 24 25 19 20 21 22 23 24 25 29 30 31 26 27 28 26 27 28 29 30 31

      April                  May                   June          

Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa

                  1      1  2  3  4  5  6               1  2  3  
2  3  4  5  6  7  8   7  8  9 10 11 12 13   4  5  6  7  8  9 10  
9 10 11 12 13 14 15  14 15 16 17 18 19 20  11 12 13 14 15 16 17  

16 17 18 19 20 21 22 21 22 23 24 25 26 27 18 19 20 21 22 23 24 23 24 25 26 27 28 29 28 29 30 31 25 26 27 28 29 30 30

       July                 August              September        

Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa

                  1         1  2  3  4  5                  1  2  
2  3  4  5  6  7  8   6  7  8  9 10 11 12   3  4  5  6  7  8  9  
9 10 11 12 13 14 15  13 14 15 16 17 18 19  10 11 12 13 14 15 16  

16 17 18 19 20 21 22 20 21 22 23 24 25 26 17 18 19 20 21 22 23 23 24 25 26 27 28 29 27 28 29 30 31 24 25 26 27 28 29 30 30 31

     October               November              December        

Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa

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              

</syntaxhighlight>

<syntaxhighlight lang="console"> $ cal 6 2023

     June 2023        

Su Mo Tu We Th Fr Sa

            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 </syntaxhighlight>

Quirks (1752)Edit

Template:More <syntaxhighlight lang="console"> $ cal 9 1752

 September 1752
S  M Tu  W Th  F  S
      1  2 14 15 16

17 18 19 20 21 22 23 24 25 26 27 28 29 30 </syntaxhighlight>

The Gregorian calendar reform was adopted by the Kingdom of Great Britain, including its possessions in North America (later to become eastern USA and Canada), in September 1752. As a result, the September 1752 cal shows the adjusted days missing. This month was the official (British) adoption of the Gregorian calendar from the previously used Julian calendar. This has been documented in the man pages for Sun Solaris as follows. "An unusual calendar is printed for September 1752. That is the month when 11 days were skipped to make up for lack of leap year adjustments."<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The Plan 9 from Bell Labs manual states: "Try Template:Mono." Date of adoption of the reform differs widely between countries so, for some users, this feature may be a bug. Special handling of 1752 is known to have appeared as early as the first edition of the Unix Programmer's Manual in 1971.<ref>Template:Cite book</ref>

See alsoEdit

ReferencesEdit

Template:Reflist Template:Refbegin

Template:Refend

SourcesEdit

External linksEdit

Template:Sister project

Template:Unix commands Template:Plan 9 commands Template:Calendaring software