source: projects/initscripts/tags/initscripts-8.91.3/src/getkey.1 @ 1108

Revision 1108, 2.1 KB checked in by daisuke, 13 years ago (diff)

import initscripts-8.90.6 from internal cvs repository

Line 
1.\" A man page for getkey(1). -*- nroff -*-
2.\"
3.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
4.\"
5.\" This copyrighted material is made available to anyone wishing to use,
6.\" modify, copy, or redistribute it subject to the terms and conditions of the
7.\" GNU General Public License v.2.
8.\"
9.\" This program is distributed in the hope that it will be useful, but WITHOUT
10.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12.\" more details.
13.\"
14.\" You should have received a copy of the GNU General Public License along
15.\" with this program; if not, write to the Free Software Foundation, Inc.,
16.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17.\"
18.\" Author: Miloslav Trmac <mitr@redhat.com>
19.TH getkey 1 "Jan 2006"
20
21.SH NAME
22getkey \- wait until a key is pressed
23
24.SH SYNOPSIS
25\fBgetkey\fR [\fIOPTION\fR]... [\fIKEYS\fR]
26
27.SH DESCRIPTION
28.B getkey
29waits until one of
30.I KEYS
31is pressed.
32If
33.I KEYS
34are not specified, any key is accepted.
35.I KEYS
36are matched case-insensitive.
37
38.SH EXIT STATUS
39.B getkey
40exits with status 0 if one of the expected keys is pressed.
41If invalid arguments are specified,
42.B getkey
43exits with status 255.
44If
45.B getkey
46is interrupted or the wait times out,
47.B getkey
48exits with other non-zero status.
49
50.SH OPTIONS
51.TP
52\fB\-c\fR, \fB\-\-wait\fR \fISECONDS\fR
53Wait only for
54.I SECONDS
55seconds.
56The default is 0, which means to wait without a time limit.
57
58.TP
59\fB\-i\fR, \fB\-\-ignore\-control\-chars\fR
60Don't treat Ctrl+C and Ctrl+D specially.
61When this option is not specified, these characters interrupt \fBgetkey\fR.
62
63.TP
64\fB\-m\fR, \fB\-\-message\fR \fIMESSAGE\fR
65Display
66.I MESSAGE
67while waiting.
68The message is used as a format string in
69.BR sprintf (3),
70with a single argument, the number of seconds left.
71Typical usage is therefore
72\fB"Press a key within %d seconds to ..."\fR.
73If
74.I MESSAGE
75contains other format string directives, the behavior is undefined and
76.B getkey
77may crash.
78
79If there is no time limit specified,
80the number of seconds left is reported as 0.
Note: See TracBrowser for help on using the repository browser.