du(1): -A should not affect block size
[unleashed.git] / share / man / man1 / ckstr.1
blobc1d53e5c970575355a4261bb14f7528ae86512c9
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2001, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH CKSTR 1 "Sep 14, 1992"
7 .SH NAME
8 ckstr, errstr, helpstr, valstr \- display a prompt; verify and return a string
9 answer
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBckstr\fR [\fB-Q\fR] [\fB-W\fR \fIwidth\fR] [ [\fB-r\fR \fIregexp\fR] [...]] [\fB-l\fR \fIlength\fR]
14      [\fB-d\fR \fIdefault\fR] [\fB-h\fR \fIhelp\fR] [\fB-e\fR \fIerror\fR] [\fB-p\fR \fIprompt\fR]
15      [\fB-k\fR \fIpid\fR [\fB- s\fR \fIsignal\fR]]
16 .fi
18 .LP
19 .nf
20 \fB/usr/sadm/bin/errstr\fR [\fB-W\fR \fIwidth\fR] [\fB-e\fR \fIerror\fR] [\fB-l\fR \fIlength\fR]
21      [ [\fB-r\fR \fIregexp\fR] [...]]
22 .fi
24 .LP
25 .nf
26 \fB/usr/sadm/bin/helpstr\fR [\fB-W\fR \fIwidth\fR] [\fB-h\fR \fIhelp\fR] [\fB-l\fR \fIlength\fR]
27      [ [\fB-r\fR \fIregexp\fR] [...]]
28 .fi
30 .LP
31 .nf
32 \fB/usr/sadm/bin/valstr\fR [\fB-l\fR \fIlength\fR] [ [\fB-r\fR \fIregexp\fR] [...]] \fIinput\fR
33 .fi
35 .SH DESCRIPTION
36 .sp
37 .LP
38 The \fBckstr\fR utility prompts a user and validates the response. It defines,
39 among other things, a prompt message whose response should be a string, text
40 for help and error messages, and a default value (which are returned if the
41 user responds with a RETURN).
42 .sp
43 .LP
44 The answer returned from this command must match the defined regular expression
45 and be no longer than the length specified. If no regular expression is given,
46 valid input must be a string with a length less than or equal to the length
47 defined with no internal, leading or trailing white space. If no length is
48 defined, the length is not checked.
49 .sp
50 .LP
51 All messages are limited in length to 79 characters and are formatted
52 automatically. Tabs and newlines are removed after a single white space
53 character in a message definition, but spaces are not removed. When a tilde is
54 placed at the beginning or end of a message definition, the default text will
55 be inserted at that point, allowing both custom text and the default text to be
56 displayed.
57 .sp
58 .LP
59 If the prompt, help or error message is not defined, the default message (as
60 defined under EXAMPLES) is displayed.
61 .sp
62 .LP
63 Three visual tool modules are linked to the \fBckstr\fR command. They are
64 \fBerrstr\fR (which formats and displays an error message on the standard
65 output), \fBhelpstr\fR (which formats and displays a help message on the
66 standard output), and \fBvalstr\fR (which validates a response).
67 .SH OPTIONS
68 .sp
69 .LP
70 The following options are supported:
71 .sp
72 .ne 2
73 .na
74 \fB\fB-d\fR \fIdefault\fR\fR
75 .ad
76 .RS 14n
77 Defines the default value as \fIdefault\fR. The default is not validated and so
78 does not have to meet any criteria.
79 .RE
81 .sp
82 .ne 2
83 .na
84 \fB\fB-e\fR \fIerror\fR\fR
85 .ad
86 .RS 14n
87 Defines the error message as \fI error\fR.
88 .RE
90 .sp
91 .ne 2
92 .na
93 \fB\fB-h\fR \fIhelp\fR\fR
94 .ad
95 .RS 14n
96 Defines the help message as \fI help\fR.
97 .RE
99 .sp
100 .ne 2
102 \fB\fB-k\fR \fIpid\fR\fR
104 .RS 14n
105 Specifies that process \fBID\fR \fIpid\fR is to be sent a signal if the user
106 chooses to quit.
110 .ne 2
112 \fB\fB-l\fR \fIlength\fR\fR
114 .RS 14n
115 Specifies the maximum length of the input.
119 .ne 2
121 \fB\fB-p\fR \fIprompt\fR\fR
123 .RS 14n
124 Defines the prompt message as \fIprompt\fR.
128 .ne 2
130 \fB\fB-Q\fR\fR
132 .RS 14n
133 Specifies that \fBquit\fR will not be allowed as a valid response.
137 .ne 2
139 \fB\fB-r\fR \fIregexp\fR\fR
141 .RS 14n
142 Specifies a regular expression, \fI regexp\fR, against which the input should
143 be validated. May include white space. If multiple expressions are defined, the
144 answer need match only one of them.
148 .ne 2
150 \fB\fB-s\fR \fIsignal\fR\fR
152 .RS 14n
153 Specifies that the process \fBID\fR \fIpid\fR defined with the \fB-k\fR option
154 is to be sent signal \fIsignal\fR when quit is chosen. If no signal is
155 specified, \fBSIGTERM\fR is used.
159 .ne 2
161 \fB\fB-W\fR \fIwidth\fR\fR
163 .RS 14n
164 Specifies that prompt, help and error messages will be formatted to a line
165 length of \fIwidth\fR.
168 .SH OPERANDS
171 The following operand is supported:
173 .ne 2
175 \fB\fIinput\fR\fR
177 .RS 9n
178 Input to be verified against format length and/or regular expression criteria.
181 .SH EXAMPLES
183 \fBExample 1 \fRDefault prompt
186 The default prompt for \fBckstr\fR is:
189 .in +2
191 example% \fBckstr\fR
192 Enter an appropriate value [?,q]:
194 .in -2
198 \fBExample 2 \fRDefault error message
201 The default error message is dependent upon the type of validation involved.
202 The user will be told either that the length or the pattern matching failed.
203 The default error message is:
206 .in +2
208 example% \fB/usr/sadm/bin/errstr\fR
209 ERROR: Please enter a string which contains no embedded,
210 leading or trailing spaces or tabs.
212 .in -2
216 \fBExample 3 \fRDefault help message
219 The default help message is also dependent upon the type of validation
220 involved.  If a regular expression has been defined, the message is:
223 .in +2
225 example% \fB/usr/sadm/bin/helpstr \fR\fB-r\fR\fB regexp\fR
226 Please enter a string which matches the following pattern:
227 regexp
229 .in -2
234 Other messages define the length requirement and the definition of a string.
237 \fBExample 4 \fRUsing the quit option
240 When the quit option is chosen (and allowed), \fBq\fR is returned along with
241 the return code \fB3\fR. Quit input gets a trailing newline.
244 \fBExample 5 \fRUsing the valstr module
247 The \fBvalstr\fR module will produce a usage message on stderr. It returns
248 \fB0\fR for success and non-zero for failure.
251 .in +2
253 example% \fB/usr/sadm/bin/valstr\fR
254 usage: valstr [\fB-l\fR length] [[\fB-r\fR regexp] [\|.\|.\|.\|]] input
256 .in -2
259 .SH EXIT STATUS
262 The following exit values are returned:
264 .ne 2
266 \fB\fB0\fR\fR
268 .RS 5n
269 Successful execution.
273 .ne 2
275 \fB\fB1\fR\fR
277 .RS 5n
278 \fBEOF\fR on input, or negative width on  \fB-W\fR option,  or usage error.
282 .ne 2
284 \fB\fB2\fR\fR
286 .RS 5n
287 Invalid regular expression.
291 .ne 2
293 \fB\fB3\fR\fR
295 .RS 5n
296 User termination (quit).
299 .SH SEE ALSO
302 \fBsignal.h\fR(3HEAD), \fBattributes\fR(5)