1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man1 / ckpath.1
blobb1786bc90667a4c0a98f46f80e315ab3c261bf6a
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 2005, 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 CKPATH 1 "Nov 4, 2005"
7 .SH NAME
8 ckpath, errpath, helppath, valpath \- display a prompt; verify and return a
9 pathname
10 .SH SYNOPSIS
11 .LP
12 .nf
13 \fBckpath\fR [\fB-Q\fR] [\fB-W\fR \fIwidth\fR] [\fB-a\fR | l] [\fB-b\fR | c | f | y]
14      [\fB-n\fR [o | z]] [\fB-rtwx\fR] [\fB-d\fR \fIdefault\fR] [\fB-h\fR \fIhelp\fR]
15      [\fB-e\fR \fIerror\fR] [\fB-p\fR \fIprompt\fR] [\fB-k\fR \fIpid\fR [\fB-s\fR \fIsignal\fR]]
16 .fi
18 .LP
19 .nf
20 \fB/usr/sadm/bin/errpath\fR [\fB-W\fR \fIwidth\fR] [\fB-a\fR | l] [\fB-b\fR | c | f | y]
21      [\fB-n\fR [o | z]] [\fB-rtwx\fR] [\fB-e\fR \fIerror\fR]
22 .fi
24 .LP
25 .nf
26 \fB/usr/sadm/bin/helppath\fR [\fB-W\fR \fIwidth\fR] [\fB-a\fR | l] [\fB-b\fR | c | f | y]
27      [\fB-n\fR [o | z]] [\fB-rtwx\fR] [\fB-h\fR \fIhelp\fR]
28 .fi
30 .LP
31 .nf
32 \fB/usr/sadm/bin/valpath\fR [\fB-a\fR | l] [\fB-b\fR | c | f | y]
33      [\fB-n\fR [o | z]] [\fB-rtwx\fR] \fIinput\fR
34 .fi
36 .SH DESCRIPTION
37 .sp
38 .LP
39 The \fBckpath\fR utility prompts a user and validates the response. It defines,
40 among other things, a prompt message whose response should be a pathname, text
41 for help and error messages, and a default value (which is returned if the user
42 responds with a RETURN).
43 .sp
44 .LP
45 The pathname must obey the criteria specified by the first group of options. If
46 no criteria is defined, the pathname must be for a normal file that does not
47 yet exist. If neither \fB-a\fR (absolute) or \fB-l\fR (relative) is given, then
48 either is assumed to be valid.
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 is
55 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 \fBckpath\fR command. They are
64 \fBerrpath\fR (which formats and displays an error message on the standard
65 output), \fBhelppath\fR (which formats and displays a help message on the
66 standard output), and \fBvalpath\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-a\fR\fR
75 .ad
76 .RS 14n
77 Pathname must be an absolute path.
78 .RE
80 .sp
81 .ne 2
82 .na
83 \fB\fB-b\fR\fR
84 .ad
85 .RS 14n
86 Pathname must be a block special file.
87 .RE
89 .sp
90 .ne 2
91 .na
92 \fB\fB-c\fR\fR
93 .ad
94 .RS 14n
95 Pathname must be a character special file.
96 .RE
98 .sp
99 .ne 2
101 \fB\fB-d\fR \fIdefault\fR\fR
103 .RS 14n
104 Defines the default value as \fIdefault\fR. The default is not validated and so
105 does not have to meet any criteria.
109 .ne 2
111 \fB\fB-e\fR \fIerror\fR\fR
113 .RS 14n
114 Defines the error message as \fI error\fR.
118 .ne 2
120 \fB\fB-f\fR\fR
122 .RS 14n
123 Pathname must be a regular file.
127 .ne 2
129 \fB\fB-h\fR \fIhelp\fR\fR
131 .RS 14n
132 Defines the help message as \fI help\fR.
136 .ne 2
138 \fB\fB-k\fR \fIpid\fR\fR
140 .RS 14n
141 Specifies that process \fBID\fR \fIpid\fR is to be sent a signal if the user
142 chooses to quit.
146 .ne 2
148 \fB\fB-l\fR\fR
150 .RS 14n
151 Pathname must be a relative path.
155 .ne 2
157 \fB\fB-n\fR\fR
159 .RS 14n
160 Pathname must not exist (must be new).
164 .ne 2
166 \fB\fB-o\fR\fR
168 .RS 14n
169 Pathname must exist (must be old).
173 .ne 2
175 \fB\fB-p\fR \fIprompt\fR\fR
177 .RS 14n
178 Defines the prompt message as \fIprompt\fR.
182 .ne 2
184 \fB\fB-Q\fR\fR
186 .RS 14n
187 Specifies that \fBquit\fR is not allowed as a valid response.
191 .ne 2
193 \fB\fB-r\fR\fR
195 .RS 14n
196 Pathname must be readable.
200 .ne 2
202 \fB\fB-s\fR \fIsignal\fR\fR
204 .RS 14n
205 Specifies that the process \fBID\fR \fIpid\fR defined with the \fB-k\fR option
206 is to be sent signal \fIsignal\fR when quit is chosen. If no signal is
207 specified, \fBSIGTERM\fR is used.
211 .ne 2
213 \fB\fB-t\fR\fR
215 .RS 14n
216 Pathname must be creatable (touchable). Pathname will be created if it does not
217 already exist.
221 .ne 2
223 \fB\fB-w\fR\fR
225 .RS 14n
226 Pathname must be writable.
230 .ne 2
232 \fB\fB-W\fR \fIwidth\fR\fR
234 .RS 14n
235 Specify that prompt, help and error messages be formatted to a line length of
236 \fIwidth\fR.
240 .ne 2
242 \fB\fB-x\fR\fR
244 .RS 14n
245 Pathname must be executable.
249 .ne 2
251 \fB\fB-y\fR\fR
253 .RS 14n
254 Pathname must be a directory.
258 .ne 2
260 \fB\fB-z\fR\fR
262 .RS 14n
263 Pathname must have a file having a size greater than zero bytes.
266 .SH OPERANDS
269 The following operand is supported:
271 .ne 2
273 \fB\fIinput\fR\fR
275 .RS 9n
276 Input to be verified against validation options.
279 .SH EXAMPLES
282 The text of the default messages for \fBckpath\fR depends upon  the criteria
283 options that have been used.
285 \fBExample 1 \fRDefault prompt
288 An example default prompt for \fBckpath\fR (using the \fB-a\fR option) is:
291 .in +2
293 example% \fBckpath \fR\fB-a\fR
294 Enter an absolute pathname [?,q]
296 .in -2
300 \fBExample 2 \fRDefault error message
303 An example default error message (using the \fB-a\fR option) is:
306 .in +2
308 example% \fB/usr/sadm/bin/errpath \fR\fB-a\fR
309 ERROR: A pathname is a filename, optionally preceded by parent
310        directories.
311        The pathname you enter: - must begin with a slash (/)
313 .in -2
317 \fBExample 3 \fRDefault help message
320 An example default help message (using the \fB-a\fR option) is:
323 .in +2
325 example% \fB/usr/sadm/bin/helppath \fR\fB-a\fR
326 A pathname is a filename, optionally preceded by parent directories.
327 The pathname you enter: - must begin with a slash (/)
329 .in -2
333 \fBExample 4 \fRThe quit option
336 When the quit option is chosen (and allowed), \fBq\fR is returned along with
337 the return code \fB3\fR. Quit input gets a trailing newline.
340 \fBExample 5 \fRUsing the valpath module
343 The \fBvalpath\fR module will produce a usage message on stderr. It returns
344 \fB0\fR for success and non-zero for failure.
347 .in +2
349 example% \fB/usr/sadm/bin/valpath\fR
350 usage: valpath [\fB-[a|l][b|c|f|y][n|[o|z]]rtwx\fR] input
351     .
352     .
353     .
355 .in -2
358 .SH EXIT STATUS
361 The following exit values are returned:
363 .ne 2
365 \fB\fB0\fR\fR
367 .RS 5n
368 Successful execution.
372 .ne 2
374 \fB\fB1\fR\fR
376 .RS 5n
377 \fBEOF\fR on input, or negative width on \fB-W\fR option, or usage error.
381 .ne 2
383 \fB\fB2\fR\fR
385 .RS 5n
386 Mutually exclusive options.
390 .ne 2
392 \fB\fB3\fR\fR
394 .RS 5n
395 User termination (quit).
399 .ne 2
401 \fB\fB4\fR\fR
403 .RS 5n
404 Mutually exclusive options.
407 .SH SEE ALSO
410 \fBsignal.h\fR(3HEAD), \fBattributes\fR(5)