GVKun编程网logo

在 Linux Debian 10 中的 cal CLI 应用程序中发现了一个错误(&在linux)

5

本文将介绍在LinuxDebian10中的calCLI应用程序中发现了一个错误的详细情况,特别是关于&在linux的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也

本文将介绍在 Linux Debian 10 中的 cal CLI 应用程序中发现了一个错误的详细情况,特别是关于&在linux的相关信息。我们将通过案例分析、数据研究等多种方式,帮助您更全面地了解这个主题,同时也将涉及一些关于32.每日一个Linux命令----cal、cal 显示日历、cal()css、CAL(1)的知识。

本文目录一览:

在 Linux Debian 10 中的 cal CLI 应用程序中发现了一个错误(&在linux)

在 Linux Debian 10 中的 cal CLI 应用程序中发现了一个错误(&在linux)

如何解决在 Linux Debian 10 中的 cal CLI 应用程序中发现了一个错误

我在 Debian Linux 10 (buster) CLI 应用程序中发现了一个错误。如果您调用 call 1752,您将在输出中看到 9 月未完成,缺少第 3-13 天。我在 Python 3(通过 BPython 3)中尝试过,使用日历模块:

  1. import calendar as c
  2. c.prcal(1752)

并且 1752 年的所有月份都显示正确)。该错误似乎仅存在于 CLI cal Linux 应用程序中。

由于这个小错误,1752 年之前的所有年份都从 cal CLI 错误输出。

有人知道这个错误吗?

解决方法

1752 年 9 月在英国及其殖民地(即后来的美国)的日子较少,因为那时他们改用公历。见例如https://www.timeanddate.com/calendar/julian-gregorian-switch.html

这不是错误。

行为显然也取决于您的语言环境。

32.每日一个Linux命令----cal

32.每日一个Linux命令----cal

描述:显示日历

用法:cal [options] [[[day]  month]  year]

选项:

-l:显示单月输出;

-3:显示临近三个月的日历;

-s:将星期日作为月的第一天;

-m:将星期一作为月的第一天;

-j:显示“julian”日期;

-y:显示当前年的日历。
示例:

[root@share19 ~]# cal -y
                               2016                               

       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       1  2  3  4  5  6          1  2  3  4  5
 3  4  5  6  7  8  9    7  8  9 10 11 12 13    6  7  8  9 10 11 12
10 11 12 13 14 15 16   14 15 16 17 18 19 20   13 14 15 16 17 18 19
17 18 19 20 21 22 23   21 22 23 24 25 26 27   20 21 22 23 24 25 26
24 25 26 27 28 29 30   28 29                  27 28 29 30 31
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  2    1  2  3  4  5  6  7             1  2  3  4
 3  4  5  6  7  8  9    8  9 10 11 12 13 14    5  6  7  8  9 10 11
10 11 12 13 14 15 16   15 16 17 18 19 20 21   12 13 14 15 16 17 18
17 18 19 20 21 22 23   22 23 24 25 26 27 28   19 20 21 22 23 24 25
24 25 26 27 28 29 30   29 30 31               26 27 28 29 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  2       1  2  3  4  5  6                1  2  3
 3  4  5  6  7  8  9    7  8  9 10 11 12 13    4  5  6  7  8  9 10
10 11 12 13 14 15 16   14 15 16 17 18 19 20   11 12 13 14 15 16 17
17 18 19 20 21 22 23   21 22 23 24 25 26 27   18 19 20 21 22 23 24
24 25 26 27 28 29 30   28 29 30 31            25 26 27 28 29 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          1  2  3  4  5                1  2  3
 2  3  4  5  6  7  8    6  7  8  9 10 11 12    4  5  6  7  8  9 10
 9 10 11 12 13 14 15   13 14 15 16 17 18 19   11 12 13 14 15 16 17
16 17 18 19 20 21 22   20 21 22 23 24 25 26   18 19 20 21 22 23 24
23 24 25 26 27 28 29   27 28 29 30            25 26 27 28 29 30 31
30 31
[root@share19 ~]# cal 2 7 2016
      July 2016     
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
31

 

cal 显示日历

cal 显示日历

命令解释

显示日历

语法
[wenjie@localhost ~]$ cal [[month] year]
  • 1

cal [[月份] 年份]

举例

列出目前这个月份的日历

[wenjie@localhost ~]$ cal 七月 2016 日 一 二 三 四 五 六 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

列出2016年整年的日历

[wenjie@localhost root]$ cal 2016 2016 一月 二月 三月 日 一 二 三 四 五 六 日 一 二 三 四 五 六 日 一 二 三 四 五 六 1 2 1 2 3 4 5 6 1 2 3 4 5 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12 10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19 17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26 24 25 26 27 28 29 30 28 29 27 28 29 30 31 31 四月 五月 六月 日 一 二 三 四 五 六 日 一 二 三 四 五 六 日 一 二 三 四 五 六 1 2 1 2 3 4 5 6 7 1 2 3 4 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11 10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18 17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25 24 25 26 27 28 29 30 29 30 31 26 27 28 29 30 七月 八月 九月 日 一 二 三 四 五 六 日 一 二 三 四 五 六 日 一 二 三 四 五 六 1 2 1 2 3 4 5 6 1 2 3 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10 10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17 17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24 24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30 31 十月 十一月 十二月 日 一 二 三 四 五 六 日 一 二 三 四 五 六 日 一 二 三 四 五 六 1 1 2 3 4 5 1 2 3 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17 16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24 23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31 30 31

列出2017年2月的日历

[wenjie@localhost ~]$ cal 2 2017 二月 2017 日 一 二 三 四 五 六 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

cal()css

cal()css

在CSS中,cal()函数可以帮助我们在处理长度单位时更加灵活方便。

cal()css

首先,cal()函数支持四则运算和优先级括号,可以方便地对各种长度单位进行计算。例如:

width: calc(50% - 2em);
padding: calc(1em + 2px);

其次,cal()函数允许使用多种长度单位,并自动进行单位换算。例如:

height: calc(100vh - 2rem);
font-size: calc(1rem + 1vw);

最后,cal()函数可以和CSS变量一起使用,方便我们在不同设备上进行样式适配。例如:

:root {
  --base-font-size: 16px;
}

@media (min-width: 768px) {
  :root {
    --base-font-size: 18px;
  }
}

body {
  font-size: calc(var(--base-font-size) * 1rem);
}

需要注意的是,cal()函数的参数和符号之间不允许有空格。例如:

/* 正确的写法 */
width: calc(50% - 2em);

/* 错误的写法 */
width: calc( 50% - 2em );

总之,cal()函数可以让我们在CSS中更灵活地使用长度单位,提高开发效率。

CAL(1)

CAL(1)

CAL(1)              BSD General Commands Manual            CAL(1)

NAME
     cal - displays a calendar

SYNOPSIS
     cal [-smjy13] [[[day] month] year]

DESCRIPTION
     Cal displays a simple calendar.  If arguments are not specified, the cur-
     rent month is displayed.  The options are as follows:

     -1         Display single month output.  (This is the default.)

     -3         Display prev/current/next month output.

     -s         Display Sunday as the first day of the week.

     -m         Display Monday as the first day of the week.

     -j         Display Julian dates (days one-based, numbered from January 1).

     -y         Display a calendar for the current year.

     -V         Display version information and exit.

     A single parameter specifies the year (1 - 9999) to be displayed; note
     the year must be fully specified: “cal 89” will not display a calendar
     for 1989.    Two parameters denote the month (1 - 12) and year.  Three
     parameters denote the day (1-31), month and year, and the day will be
     highlighted if the calendar is displayed on a terminal.  If no parameters
     are specified, the current month’s calendar is displayed.

     A year starts on Jan 1. The first day of the week is determined by the
     locale.

     The Gregorian Reformation is assumed to have occurred in 1752 on the 3rd
     of September.  By this time, most countries had recognized the reforma-
     tion (although a few did not recognize it until the early 1900’s.)     Ten
     days following that date were eliminated by the reformation, so the cal-
     endar for that month is a bit unusual.

HISTORY
     A cal command appeared in Version 6 AT&T UNIX.

OTHER VERSIONS
     Several much more elaborate versions of this program exist, with support
     for colors, holidays, birthdays, reminders and appointments, etc. For
     example, try the cal from http://home.sprynet.com/~cbagwell/projects.html
     or GNU gcal.

AVAILABILITY
     The cal command is part of the util-linux-ng package and is available
     from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

BSD                 June 6, 1993                   BSD

关于在 Linux Debian 10 中的 cal CLI 应用程序中发现了一个错误&在linux的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于32.每日一个Linux命令----cal、cal 显示日历、cal()css、CAL(1)等相关知识的信息别忘了在本站进行查找喔。

本文标签:

上一篇在较旧的内核中编译为较新的 linux 内核制作的驱动程序

下一篇如何为使用 X11 的 linux 创建一个像浮动窗口一样的系统托盘?(linux做窗口)