'\" te .\" Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. .\" Copyright 1989 AT&T .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures .\" Portions Copyright (c) 1992, 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 sleep 1 "2011 年 7 月 28 日" "SunOS 5.11" "ユーザーコマンド" .SH 名前 sleep \- 実行の一定期間保留 .SH 形式 .LP .nf \fB/usr/bin/sleep\fR \fIinterval\fR[\fBd|h|m|s\fR]... .fi .SH 機能説明 .sp .LP \fBsleep\fR は、少なくとも \fIseconds\fR で指定された秒数の間、または \fBSIGALRM\fR シグナルを受信するまで実行を中断します。\fIseconds\fR オペランドは浮動小数点数として指定できますが、通常、実際の精度はその基盤となるシステムによって異なります。 .SH オペランド .sp .ne 2 .mk .na \fB\fIinterval\fR\fR .ad .RS 12n .rt 実行を中断する時間を指定する浮動小数点数。浮動小数点数は、C99/XPG6 で必要なすべての形式 (\fBInf\fR や \fBinfinite\fR などの定数を含む) で指定できます。4 つの接尾辞のうち 1 つをオプションで指定できます。これは、指定した数が、日 (\fBd\fR)、時 (\fBh\fR)、分 (\fBm\fR)、または秒 (\fBs\fR) であることを示します。接尾辞を指定しない場合、間隔は秒とみなされます。複数の間隔が指定された場合、それらは合計されます。個々の間隔は負にできますが、合計はゼロ以上である必要があります。 .RE .SH 使用例 .LP \fB例 1 \fRコマンドの実行の中断 .sp .LP 次の例では、特定の時間が経過したあとにコマンドを実行します。 .sp .in +2 .nf example% \fB(sleep 105; \fIcommand\fR)&\fR .fi .in -2 .sp .LP \fB例 2 \fR時間ごとのコマンドの実行 .sp .LP 次の例では、ある時間ごとにコマンドを実行します。 .sp .in +2 .nf example% \fBwhile true do \fIcommand\fR sleep 37 done\fR .fi .in -2 .sp .LP \fB例 3 \fRコマンドの実行を永久に中断 .sp .LP 次の例では、永久に、または\fBSIGALRM\fR シグナルが受信されるまで、コマンドの実行を中断します。 .sp .in +2 .nf example% sleep Inf .fi .in -2 .sp .LP \fB例 4 \fRコマンドの実行を、0.5 秒間中断する .sp .LP 代わりに浮動小数点値 "0.5" を使用して、コマンドの実行を \fB0.5\fR 秒間中断する .sp .in +2 .nf example% printf "%a\en" 0.5 0x1.0000000000000000000000000000p-01 .fi .in -2 .sp .sp .in +2 .nf example% sleep 0x1.0000000000000000000000000000p-01 .fi .in -2 .sp .LP \fB例 5 \fR実行を 23 時間中断する .sp .LP 次の例では、文字接尾辞を使用して、実行を 23 時間中断します。 .sp .in +2 .nf example% sleep 1d -1h .fi .in -2 .sp .SH 環境 .sp .LP \fBsleep\fR の実行に影響を与える次の環境変数についての詳細は、\fBenviron\fR(5) を参照してください。\fBLANG\fR、\fBLC_ALL\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR、および \fBNLSPATH\fR。 .SH 終了ステータス .sp .LP 次の終了ステータスが返されます。 .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt \fItime\fR で示す秒数以上のあいだ実行を中断することに成功した、または \fBSIGALRM\fR シグナルを受信した (「注意事項」を参照)。 .RE .sp .ne 2 .mk .na \fB>\fB0\fR\fR .ad .RS 6n .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 _ インタフェースの安定性確実 _ 標準T{ \fBstandards\fR(5) を参照してください。 T} .TE .SH 関連項目 .sp .LP \fBwait\fR(1), \fBalarm\fR(2), \fBsleep\fR(3C), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5) .SH 注意事項 .sp .LP \fBSIGALRM\fR シグナルを受信すると、\fBsleep\fR ユーティリティーは次の動作のうちどちらかを行います。 .RS +4 .TP .ie t \(bu .el o 終了ステータス 0 で正常終了します。 .RE .RS +4 .TP .ie t \(bu .el o 事実上、 シグナルを無視します。 .RE .sp .LP その他のシグナルを受信した場合には、\fBsleep\fR ユーティリティーは標準のアクションを行います。