CAL(1P)

πŸ’– CAL(1P) β€” the POSIX Programmer's Manual, bestie edition πŸ’–

okay so this is CAL(1P) from the POSIX Programmer's Manual, and we are gonna get you so cozy with it. πŸŽ€


🫢 PROLOG 🫢

Okay real talk first, bestie, because this part matters:

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go consult the corresponding Linux manual page for details of Linux behavior), or honestly the interface may not even be implemented on Linux at all. iykyk πŸ’…


✨ NAME ✨

cal β€” print a calendar πŸ“…


🌸 SYNOPSIS 🌸

cal [[month] year]

πŸ’œ DESCRIPTION πŸ’œ

The cal utility shall write a calendar to standard output, and the way it does that is iconic actually: it uses the Julian calendar for dates from January 1, 1 through September 2, 1752, and the Gregorian calendar for dates from September 14, 1752 through December 31, 9999, as though the Gregorian calendar had been adopted on September 14, 1752. time travel era fr fr πŸ¦‹

Now, what you get depends on what you hand it:

  • If no operands are given, cal shall produce a one-month calendar for the current month in the current year. πŸ—“οΈ
  • If only the year operand is given, cal shall produce a calendar for all twelve months in the given calendar year. ✨
  • If both month and year operands are given, cal shall produce a one-month calendar for the given month in the given year. πŸ’–

πŸ‘‘ OPTIONS πŸ‘‘

None. Not a single one. The girl is serving minimalism, she needs nothing. πŸ’…


πŸŽ€ OPERANDS πŸŽ€

The following operands shall be supported:

  • month β€” Specify the month to be displayed, represented as a decimal integer from 1 (January) to 12 (December). 🌸
  • year β€” Specify the year for which the calendar is displayed, represented as a decimal integer from 1 to 9999. ⭐

🌈 STDIN 🌈

Not used. She's not reading your messages, bestie, she's just posting. πŸ™ˆ


πŸ“ INPUT FILES πŸ“

None.


πŸ’… ENVIRONMENT VARIABLES πŸ’…

The following environment variables shall affect the execution of cal:

  • LANG β€” Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1‐2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
  • LC_ALL β€” If set to a non-empty string value, override the values of all the other internationalization variables. she's the boss, periodt.
  • LC_CTYPE β€” Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
  • LC_MESSAGES β€” Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error, and informative messages written to standard output.
  • LC_TIME β€” Determine the format and contents of the calendar. πŸ—“οΈ (yes this one is literally the calendar vibe-setter)
  • NLSPATH β€” Determine the location of message catalogs for the processing of LC_MESSAGES.
  • TZ β€” Determine the timezone used to calculate the value of the current month. ⏰

🧚 ASYNCHRONOUS EVENTS 🧚

Default. no drama, standard behavior, we love that for her.


⭐ STDOUT ⭐

The standard output shall be used to display the calendar, in an unspecified format. so don't come for the layout, it's unspecified bestie 😭


πŸ’€ STDERR πŸ’€

The standard error shall be used only for diagnostic messages. That's it. Nothing else lives there. 🚫


πŸ¦‹ OUTPUT FILES πŸ¦‹

None.


🌸 EXTENDED DESCRIPTION 🌸

None. Nothing extra. she said what she said. πŸ’…


πŸ”₯ EXIT STATUS πŸ”₯

The following exit values shall be returned:

  • 0 β€” Successful completion. πŸŽ‰ we ate.
  • >0 β€” An error occurred. 😭

πŸ’œ CONSEQUENCES OF ERRORS πŸ’œ

Default.

The following sections are informative. (yes, that means they're the gossip, not the rules)


πŸŽ€ APPLICATION USAGE πŸŽ€

Note that:

cal 83

refers to A.D. 83, not 1983. ⚠️ Like, the year 83. Ancient Rome era. Not your aunt's birth year. Do not get this twisted, bestie. πŸ›οΈ


πŸ“ EXAMPLES πŸ“

None.


🧚 RATIONALE 🧚

Okay so this is the tea β˜• and it's actually kind of juicy:

Earlier versions of this standard incorrectly required that the command:

cal 2000

write a one-month calendar for the current calendar month (no matter what the current year is) in the year 2000 to standard output. Not me finding out the old standard was just wrong the whole time 😭

This did not match historic practice in any known version of the cal utility. The description has been updated to match historic practice. When only the year operand is given, cal writes a twelve-month calendar for the specified year. ✨ fixed it, slay.


🌈 FUTURE DIRECTIONS 🌈

A future version of this standard may support locale-specific recognition of the date of adoption of the Gregorian calendar. so like, watch this space, the calendar lore might get even deeper. πŸ¦‹


πŸ’– SEE ALSO πŸ’–

The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment Variables


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie!! 🌸✨ This one came to you courtesy of IEEE/The Open Group, 2017 β€” mwah, ty for the lore, we're obsessed πŸ’–πŸ«ΆπŸŽ€ cal rights!

πŸ“¦ where this page comes from