summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/ckpath.1
blob: b6f488703fb452fe4a18cc7940102d8344bcfc18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
'\" te
.\"  Copyright 1989 AT&T  Copyright (c) 2005, Sun Microsystems, Inc.  All Rights Reserved
.\" 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.
.\" 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.
.\" 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]
.TH CKPATH 1 "Nov 4, 2005"
.SH NAME
ckpath, errpath, helppath, valpath \- display a prompt; verify and return a
pathname
.SH SYNOPSIS
.LP
.nf
\fBckpath\fR [\fB-Q\fR] [\fB-W\fR \fIwidth\fR] [\fB-a\fR | l] [\fB-b\fR | c | f | y]
     [\fB-n\fR [o | z]] [\fB-rtwx\fR] [\fB-d\fR \fIdefault\fR] [\fB-h\fR \fIhelp\fR]
     [\fB-e\fR \fIerror\fR] [\fB-p\fR \fIprompt\fR] [\fB-k\fR \fIpid\fR [\fB-s\fR \fIsignal\fR]]
.fi

.LP
.nf
\fB/usr/sadm/bin/errpath\fR [\fB-W\fR \fIwidth\fR] [\fB-a\fR | l] [\fB-b\fR | c | f | y]
     [\fB-n\fR [o | z]] [\fB-rtwx\fR] [\fB-e\fR \fIerror\fR]
.fi

.LP
.nf
\fB/usr/sadm/bin/helppath\fR [\fB-W\fR \fIwidth\fR] [\fB-a\fR | l] [\fB-b\fR | c | f | y]
     [\fB-n\fR [o | z]] [\fB-rtwx\fR] [\fB-h\fR \fIhelp\fR]
.fi

.LP
.nf
\fB/usr/sadm/bin/valpath\fR [\fB-a\fR | l] [\fB-b\fR | c | f | y]
     [\fB-n\fR [o | z]] [\fB-rtwx\fR] \fIinput\fR
.fi

.SH DESCRIPTION
.sp
.LP
The \fBckpath\fR utility prompts a user and validates the response. It defines,
among other things, a prompt message whose response should be a pathname, text
for help and error messages, and a default value (which is returned if the user
responds with a RETURN).
.sp
.LP
The pathname must obey the criteria specified by the first group of options. If
no criteria is defined, the pathname must be for a normal file that does not
yet exist. If neither \fB-a\fR (absolute) or \fB-l\fR (relative) is given, then
either is assumed to be valid.
.sp
.LP
All messages are limited in length to 79 characters and are formatted
automatically. Tabs and newlines are removed after a single white space
character in a message definition, but spaces are not removed. When a tilde is
placed at the beginning or end of a message definition, the default text is
inserted at that point, allowing both custom text and the default text to be
displayed.
.sp
.LP
If the prompt, help or error message is not defined, the default message (as
defined under EXAMPLES) is displayed.
.sp
.LP
Three visual tool modules are linked to the \fBckpath\fR command. They are
\fBerrpath\fR (which formats and displays an error message on the standard
output), \fBhelppath\fR (which formats and displays a help message on the
standard output), and \fBvalpath\fR (which validates a response).
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 14n
Pathname must be an absolute path.
.RE

.sp
.ne 2
.na
\fB\fB-b\fR\fR
.ad
.RS 14n
Pathname must be a block special file.
.RE

.sp
.ne 2
.na
\fB\fB-c\fR\fR
.ad
.RS 14n
Pathname must be a character special file.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR \fIdefault\fR\fR
.ad
.RS 14n
Defines the default value as \fIdefault\fR. The default is not validated and so
does not have to meet any criteria.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR \fIerror\fR\fR
.ad
.RS 14n
Defines the error message as \fI error\fR.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 14n
Pathname must be a regular file.
.RE

.sp
.ne 2
.na
\fB\fB-h\fR \fIhelp\fR\fR
.ad
.RS 14n
Defines the help message as \fI help\fR.
.RE

.sp
.ne 2
.na
\fB\fB-k\fR \fIpid\fR\fR
.ad
.RS 14n
Specifies that process \fBID\fR \fIpid\fR is to be sent a signal if the user
chooses to quit.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 14n
Pathname must be a relative path.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 14n
Pathname must not exist (must be new).
.RE

.sp
.ne 2
.na
\fB\fB-o\fR\fR
.ad
.RS 14n
Pathname must exist (must be old).
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIprompt\fR\fR
.ad
.RS 14n
Defines the prompt message as \fIprompt\fR.
.RE

.sp
.ne 2
.na
\fB\fB-Q\fR\fR
.ad
.RS 14n
Specifies that \fBquit\fR is not allowed as a valid response.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 14n
Pathname must be readable.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR \fIsignal\fR\fR
.ad
.RS 14n
Specifies that the process \fBID\fR \fIpid\fR defined with the \fB-k\fR option
is to be sent signal \fIsignal\fR when quit is chosen. If no signal is
specified, \fBSIGTERM\fR is used.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 14n
Pathname must be creatable (touchable). Pathname will be created if it does not
already exist.
.RE

.sp
.ne 2
.na
\fB\fB-w\fR\fR
.ad
.RS 14n
Pathname must be writable.
.RE

.sp
.ne 2
.na
\fB\fB-W\fR \fIwidth\fR\fR
.ad
.RS 14n
Specify that prompt, help and error messages be formatted to a line length of
\fIwidth\fR.
.RE

.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 14n
Pathname must be executable.
.RE

.sp
.ne 2
.na
\fB\fB-y\fR\fR
.ad
.RS 14n
Pathname must be a directory.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR\fR
.ad
.RS 14n
Pathname must have a file having a size greater than zero bytes.
.RE

.SH OPERANDS
.sp
.LP
The following operand is supported:
.sp
.ne 2
.na
\fB\fIinput\fR\fR
.ad
.RS 9n
Input to be verified against validation options.
.RE

.SH EXAMPLES
.sp
.LP
The text of the default messages for \fBckpath\fR depends upon  the criteria
options that have been used.
.LP
\fBExample 1 \fRDefault prompt
.sp
.LP
An example default prompt for \fBckpath\fR (using the \fB-a\fR option) is:

.sp
.in +2
.nf
example% \fBckpath \fR\fB-a\fR
Enter an absolute pathname [?,q]
.fi
.in -2
.sp

.LP
\fBExample 2 \fRDefault error message
.sp
.LP
An example default error message (using the \fB-a\fR option) is:

.sp
.in +2
.nf
example% \fB/usr/sadm/bin/errpath \fR\fB-a\fR
ERROR: A pathname is a filename, optionally preceded by parent
       directories.
       The pathname you enter: - must begin with a slash (/)
.fi
.in -2
.sp

.LP
\fBExample 3 \fRDefault help message
.sp
.LP
An example default help message (using the \fB-a\fR option) is:

.sp
.in +2
.nf
example% \fB/usr/sadm/bin/helppath \fR\fB-a\fR
A pathname is a filename, optionally preceded by parent directories.
The pathname you enter: - must begin with a slash (/)
.fi
.in -2
.sp

.LP
\fBExample 4 \fRThe quit option
.sp
.LP
When the quit option is chosen (and allowed), \fBq\fR is returned along with
the return code \fB3\fR. Quit input gets a trailing newline.

.LP
\fBExample 5 \fRUsing the valpath module
.sp
.LP
The \fBvalpath\fR module will produce a usage message on stderr. It returns
\fB0\fR for success and non-zero for failure.

.sp
.in +2
.nf
example% \fB/usr/sadm/bin/valpath\fR
usage: valpath [\fB-[a|l][b|c|f|y][n|[o|z]]rtwx\fR] input
    .
    .
    .
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Successful execution.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
\fBEOF\fR on input, or negative width on \fB-W\fR option, or usage error.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Mutually exclusive options.
.RE

.sp
.ne 2
.na
\fB\fB3\fR\fR
.ad
.RS 5n
User termination (quit).
.RE

.sp
.ne 2
.na
\fB\fB4\fR\fR
.ad
.RS 5n
Mutually exclusive options.
.RE

.SH SEE ALSO
.sp
.LP
.BR signal.h (3HEAD),
.BR attributes (7)