'\" te .\" Copyright 1989 AT&T Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved .TH ckpath 1 "4 Nov 2005" "SunOS 5.11" "User Commands" .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 .mk .na \fB\fB-a\fR\fR .ad .RS 14n .rt Pathname must be an absolute path. .RE .sp .ne 2 .mk .na \fB\fB-b\fR\fR .ad .RS 14n .rt Pathname must be a block special file. .RE .sp .ne 2 .mk .na \fB\fB-c\fR\fR .ad .RS 14n .rt Pathname must be a character special file. .RE .sp .ne 2 .mk .na \fB\fB-d\fR \fIdefault\fR\fR .ad .RS 14n .rt 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 .mk .na \fB\fB-e\fR \fIerror\fR\fR .ad .RS 14n .rt Defines the error message as \fI error\fR. .RE .sp .ne 2 .mk .na \fB\fB-f\fR\fR .ad .RS 14n .rt Pathname must be a regular file. .RE .sp .ne 2 .mk .na \fB\fB-h\fR \fIhelp\fR\fR .ad .RS 14n .rt Defines the help message as \fI help\fR. .RE .sp .ne 2 .mk .na \fB\fB-k\fR \fIpid\fR\fR .ad .RS 14n .rt Specifies that process \fBID\fR \fIpid\fR is to be sent a signal if the user chooses to quit. .RE .sp .ne 2 .mk .na \fB\fB-l\fR\fR .ad .RS 14n .rt Pathname must be a relative path. .RE .sp .ne 2 .mk .na \fB\fB-n\fR\fR .ad .RS 14n .rt Pathname must not exist (must be new). .RE .sp .ne 2 .mk .na \fB\fB-o\fR\fR .ad .RS 14n .rt Pathname must exist (must be old). .RE .sp .ne 2 .mk .na \fB\fB-p\fR \fIprompt\fR\fR .ad .RS 14n .rt Defines the prompt message as \fIprompt\fR. .RE .sp .ne 2 .mk .na \fB\fB-Q\fR\fR .ad .RS 14n .rt Specifies that \fBquit\fR is not allowed as a valid response. .RE .sp .ne 2 .mk .na \fB\fB-r\fR\fR .ad .RS 14n .rt Pathname must be readable. .RE .sp .ne 2 .mk .na \fB\fB-s\fR \fIsignal\fR\fR .ad .RS 14n .rt 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 .mk .na \fB\fB-t\fR\fR .ad .RS 14n .rt Pathname must be creatable (touchable). Pathname will be created if it does not already exist. .RE .sp .ne 2 .mk .na \fB\fB-w\fR\fR .ad .RS 14n .rt Pathname must be writable. .RE .sp .ne 2 .mk .na \fB\fB-W\fR \fIwidth\fR\fR .ad .RS 14n .rt Specify that prompt, help and error messages be formatted to a line length of \fIwidth\fR. .RE .sp .ne 2 .mk .na \fB\fB-x\fR\fR .ad .RS 14n .rt Pathname must be executable. .RE .sp .ne 2 .mk .na \fB\fB-y\fR\fR .ad .RS 14n .rt Pathname must be a directory. .RE .sp .ne 2 .mk .na \fB\fB-z\fR\fR .ad .RS 14n .rt 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 .mk .na \fB\fIinput\fR\fR .ad .RS 9n .rt 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 .mk .na \fB\fB0\fR\fR .ad .RS 5n .rt Successful execution. .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 5n .rt \fBEOF\fR on input, or negative width on \fB-W\fR option, or usage error. .RE .sp .ne 2 .mk .na \fB\fB2\fR\fR .ad .RS 5n .rt Mutually exclusive options. .RE .sp .ne 2 .mk .na \fB\fB3\fR\fR .ad .RS 5n .rt User termination (quit). .RE .sp .ne 2 .mk .na \fB\fB4\fR\fR .ad .RS 5n .rt Mutually exclusive options. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Availabilitysystem/core-os .TE .SH SEE ALSO .sp .LP \fBsignal.h\fR(3HEAD), \fBattributes\fR(5)