'\" te .\" Copyright 1989 AT&T Copyright (c) 2003, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 2001, X/Open Company Limited All Rights Reserved .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation.Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation.In the following statement, the phrase"this text" refers to portions of the system documentation.Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.In the event of any discrepancy between these versions 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.This notice shall appear on any product containing this material. .TH calendar 1 "1995 年 2 月 1 日" "SunOS 5.11" "用户命令" .SH 名称 calendar \- 提醒服务 .SH 用法概要 .LP .nf \fBcalendar\fR [\fB-\fR] .fi .SH 描述 .sp .LP \fBcalendar\fR 实用程序查询当前目录中的文件 \fBcalendar\fR 并将包含今天或明天日期的行(日期位于行中的任意位置)写入到标准输出。可以识别大多数合理的“月-日”日期,例如 \fBAug. 24\fR、\fBaugust 24\fR、\fB8/24\fR 等等,但不能识别 \fB24 August\fR 或 \fB24/8\fR。在周五和周末,“明天”会扩展到周一。可以像通常一样使用 \fBcrontab\fR(1) 或 \fBat\fR(1) 命令调用 \fBcalendar\fR。 .sp .LP 当提供了可选参数 \fB-\fR 时,将为登录目录中有 \fBcalendar\fR 文件的每个用户执行 \fBcalendar\fR 并通过 \fBmail\fR(1) 向他们发送任何正数结果。通常,UNIX 操作系统中的工具每天都执行此工作(请参见\fBcron\fR(1M))。 .sp .LP 如果设置了环境变量 \fBDATEMSK\fR,则 \fBcalendar\fR 将使用其值作为包含格式字符串的模板文件的全路径名。这些字符串包含转换规范和文本字符,通过适当设置环境变量 \fBLANG\fR 或 \fBLC_TIME\fR 可提供一组更丰富的多种语言的受支持的日期格式;请参见 \fBenviron\fR(5)。有关允许的转换规范的列表,请参见 \fBstrftime\fR(3C)。 .SH 示例 .LP \fB示例 1 \fR模板的可能内容 .sp .LP 以下示例显示了模板的可能内容: .sp .in +2 .nf %B %eth of the year %Y .fi .in -2 .sp .sp .LP \fB%B\fR 表示完整的月份名称,\fB%e\fR 表示月份中的天,\fB%Y\fR 表示年份(4 位数)。 .sp .LP 如果 \fBDATEMSK\fR 设置为此模板,则以下 \fBcalendar\fR 文件将有效: .sp .in +2 .nf March 7th of the year 1989 .fi .in -2 .sp .SH 环境变量 .sp .LP 有关影响 \fBcalendar\fR 执行的以下环境变量的说明,请参见 \fBenviron\fR(5):\fBLC_CTYPE\fR、\fBLC_TIME\fR、\fBLC_MESSAGES\fR、\fBNLSPATH\fR 和 \fBTZ\fR。 .SH 退出状态 .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 7n .rt 成功完成。 .RE .sp .ne 2 .mk .na \fB\fB>0\fR \fR .ad .RS 7n .rt 出现错误。 .RE .SH 文件 .sp .ne 2 .mk .na \fB\fB/etc/passwd\fR \fR .ad .RS 21n .rt 系统口令文件 .RE .sp .ne 2 .mk .na \fB\fB/tmp/cal*\fR \fR .ad .RS 21n .rt \fBcalendar\fR 使用的临时文件 .RE .sp .ne 2 .mk .na \fB\fB/usr/lib/calprog\fR \fR .ad .RS 21n .rt 用来确定今天和明天日期的程序 .RE .SH 属性 .sp .LP 有关下列属性的说明,请参见 \fBattributes\fR(5): .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性类型属性值 _ 可用性system/core-os .TE .SH 另请参见 .sp .LP \fBat\fR(1)、\fBcrontab\fR(1)、\fBmail\fR(1)、\fBcron\fR(1M)、\fBypbind\fR(1M)、\fBstrftime\fR(3C)、\fBattributes\fR(5)、\fBenviron\fR(5) .SH 附注 .sp .LP 不会列显以空格开头的相应行。 .sp .LP 要获得提醒服务,日历必须是公开信息。 .sp .LP \fBcalendar\fR 的扩展概念“明天”不考虑假日。 .sp .LP \fB-\fR 参数仅对计算机本地的日历文件起作用;\fBcalendar\fR 对通过 \fBNFS.\fR 远程挂载的日历文件不起作用。因此,只应当在存在起始目录的有磁盘计算机上运行 '\fBcalendar \fR\fB-\fR'。在无磁盘的客户机上运行它没有效果。 .sp .LP \fBcalendar\fR 不再位于缺省的 root crontab 中。因为 '\fBcalendar \fR\fB-\fR' 可能会引发网络负担,因此在使用大型 passwd.byname 映射运行 \fBypbind\fR(1M) 的环境中不宜使用该选项。不过,如果使用 \fBcalendar\fR 的好处超过了对网络的影响,超级用户可以运行 '\fBcrontab\fR \fB-e\fR' 来编辑 root crontab。另外,单个用户可能希望使用 '\fBcrontab\fR \fB-e\fR' 来编辑自己的 crontab,使 \fBcron\fR 在不带 \fB-\fR 参数的情况下调用 \fBcalendar\fR,从而将输出传输到发给他们自己的邮件。