1ckpath(1)                        User Commands                       ckpath(1)
2
3
4

NAME

6       ckpath,  errpath,  helppath,  valpath  -  display  a prompt; verify and
7       return a pathname
8

SYNOPSIS

10       ckpath [-Q] [-W width] [-a | l] [-b | c | f | y]
11            [-n [o | z]] [-rtwx] [-d default] [-h help]
12            [-e error] [-p prompt] [-k pid [-s signal]]
13
14
15       /usr/sadm/bin/errpath [-W width] [-a | l] [-b | c | f | y]
16            [-n [o | z]] [-rtwx] [-e error]
17
18
19       /usr/sadm/bin/helppath [-W width] [-a | l] [-b | c | f | y]
20            [-n [o | z]] [-rtwx] [-h help]
21
22
23       /usr/sadm/bin/valpath [-a | l] [-b | c | f | y]
24            [-n [o | z]] [-rtwx] input
25
26

DESCRIPTION

28       The ckpath utility prompts  a  user  and  validates  the  response.  It
29       defines,  among other things, a prompt message whose response should be
30       a pathname, text for help and  error  messages,  and  a  default  value
31       (which is returned if the user responds with a RETURN).
32
33
34       The  pathname  must  obey  the criteria specified by the first group of
35       options. If no criteria is defined, the pathname must be for  a  normal
36       file that does not yet exist. If neither -a (absolute) or -l (relative)
37       is given, then either is assumed to be valid.
38
39
40       All messages are limited in length to 79 characters and  are  formatted
41       automatically. Tabs and newlines are removed after a single white space
42       character in a message definition, but spaces are not removed.  When  a
43       tilde  is  placed  at the beginning or end of a message definition, the
44       default text is inserted at that point, allowing both custom  text  and
45       the default text to be displayed.
46
47
48       If  the  prompt, help or error message is not defined, the default mes‐
49       sage (as defined under EXAMPLES) is displayed.
50
51
52       Three visual tool modules are linked to the ckpath  command.  They  are
53       errpath  (which  formats  and displays an error message on the standard
54       output), helppath (which formats and displays a  help  message  on  the
55       standard output), and valpath (which validates a response).
56

OPTIONS

58       The following options are supported:
59
60       -a            Pathname must be an absolute path.
61
62
63       -b            Pathname must be a block special file.
64
65
66       -c            Pathname must be a character special file.
67
68
69       -d default    Defines  the default value as default. The default is not
70                     validated and so does not have to meet any criteria.
71
72
73       -e error      Defines the error message as  error.
74
75
76       -f            Pathname must be a regular file.
77
78
79       -h help       Defines the help message as  help.
80
81
82       -k pid        Specifies that process ID pid is to be sent a  signal  if
83                     the user chooses to quit.
84
85
86       -l            Pathname must be a relative path.
87
88
89       -n            Pathname must not exist (must be new).
90
91
92       -o            Pathname must exist (must be old).
93
94
95       -p prompt     Defines the prompt message as prompt.
96
97
98       -Q            Specifies that quit is not allowed as a valid response.
99
100
101       -r            Pathname must be readable.
102
103
104       -s signal     Specifies  that  the  process  ID pid defined with the -k
105                     option is to be sent signal signal when quit  is  chosen.
106                     If no signal is specified, SIGTERM is used.
107
108
109       -t            Pathname  must be creatable (touchable). Pathname will be
110                     created if it does not already exist.
111
112
113       -w            Pathname must be writable.
114
115
116       -W width      Specify that prompt, help and error messages be formatted
117                     to a line length of width.
118
119
120       -x            Pathname must be executable.
121
122
123       -y            Pathname must be a directory.
124
125
126       -z            Pathname must have a file having a size greater than zero
127                     bytes.
128
129

OPERANDS

131       The following operand is supported:
132
133       input    Input to be verified against validation options.
134
135

EXAMPLES

137       The text of the default messages for ckpath depends upon  the  criteria
138       options that have been used.
139
140       Example 1 Default prompt
141
142
143       An example default prompt for ckpath (using the -a option) is:
144
145
146         example% ckpath -a
147         Enter an absolute pathname [?,q]
148
149
150
151       Example 2 Default error message
152
153
154       An example default error message (using the -a option) is:
155
156
157         example% /usr/sadm/bin/errpath -a
158         ERROR: A pathname is a filename, optionally preceded by parent
159                directories.
160                The pathname you enter: - must begin with a slash (/)
161
162
163
164       Example 3 Default help message
165
166
167       An example default help message (using the -a option) is:
168
169
170         example% /usr/sadm/bin/helppath -a
171         A pathname is a filename, optionally preceded by parent directories.
172         The pathname you enter: - must begin with a slash (/)
173
174
175
176       Example 4 The quit option
177
178
179       When  the quit option is chosen (and allowed), q is returned along with
180       the return code 3. Quit input gets a trailing newline.
181
182
183       Example 5 Using the valpath module
184
185
186       The valpath module will produce a usage message on stderr.  It  returns
187       0 for success and non-zero for failure.
188
189
190         example% /usr/sadm/bin/valpath
191         usage: valpath [-[a|l][b|c|f|y][n|[o|z]]rtwx] input
192             .
193             .
194             .
195
196
197

EXIT STATUS

199       The following exit values are returned:
200
201       0    Successful execution.
202
203
204       1    EOF on input, or negative width on -W option, or usage error.
205
206
207       2    Mutually exclusive options.
208
209
210       3    User termination (quit).
211
212
213       4    Mutually exclusive options.
214
215

ATTRIBUTES

217       See attributes(5) for descriptions of the following attributes:
218
219
220
221
222       ┌─────────────────────────────┬─────────────────────────────┐
223       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
224       ├─────────────────────────────┼─────────────────────────────┤
225       │Availability                 │SUNWcsu                      │
226       └─────────────────────────────┴─────────────────────────────┘
227

SEE ALSO

229       signal.h(3HEAD), attributes(5)
230
231
232
233SunOS 5.11                        4 Nov 2005                         ckpath(1)
Impressum