'\" te
.\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
.\" 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 SET 1 "Nov 20, 2007"
.SH NAME
set, unset, setenv, unsetenv, export \- shell built-in functions to determine
the characteristics for environmental variables of the current shell and its
descendents
.SH SYNOPSIS
.SS "sh"
.LP
.nf
\fBset\fR [\fB--aefhkntuvx\fR [\fIargument\fR]]...
.fi

.LP
.nf
\fBunset\fR [\fIname\fR]...
.fi

.LP
.nf
\fBexport\fR [\fIname\fR]...
.fi

.SS "csh"
.LP
.nf
\fBset\fR [\fIvar\fR [= \fIvalue\fR]]
.fi

.LP
.nf
\fBset\fR \fIvar\fR [\fIn\fR] = \fIword\fR
.fi

.LP
.nf
\fBunset\fR \fIpattern\fR
.fi

.LP
.nf
\fBsetenv\fR [\fIVAR\fR [\fIword\fR]]
.fi

.LP
.nf
\fBunsetenv\fR \fIvariable\fR
.fi

.SS "ksh"
.LP
.nf
\fBset\fR [\(+-abCefhkmnopstuvx] [\(+-o \fIoption\fR]... [\(+-A \fIname\fR]
     [\fIarg\fR]...
.fi

.LP
.nf
\fBunset\fR [\fB-f\fR] \fIname\fR...
.fi

.LP
.nf
\fB**export\fR [\fIname\fR [=\fIvalue\fR]]...
.fi

.LP
.nf
\fB**export\fR [\fB-p\fR]
.fi

.SS "ksh93"
.LP
.nf
\fB+set\fR [\(+-abCefGhkmnoprstuvx] [\(+-o \fIoption\fR]... [\(+-A \fIvname\fR]
     [\fIarg\fR]...
.fi

.LP
.nf
\fB+unset\fR [\fB-fnv\fR] \fIvname\fR...
.fi

.LP
.nf
\fB++export\fR [\fB-p\fR] [\fIname\fR[=\fIvalue\fR]]...
.fi

.SH DESCRIPTION
.SS "sh"
.sp
.LP
The \fBset\fR built-in command has the following options:
.sp
.ne 2
.na
\fB\fB--\fR\fR
.ad
.RS 6n
Does not change any of the flags. This option is useful in setting \fB$1\fR to
\fB\(mi\fR\&.
.RE

.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 6n
Marks variables which are modified or created for export.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.RS 6n
Exits immediately if a command exits with a non-zero exit status.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
Disables file name generation.
.RE

.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.RS 6n
Locates and remembers function commands as functions are defined. Function
commands are normally located when the function is executed.
.RE

.sp
.ne 2
.na
\fB\fB-k\fR\fR
.ad
.RS 6n
All keyword arguments are placed in the environment for a command, not just
those that precede the command name.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 6n
Reads commands but does not execute them.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 6n
Exits after reading and executing one command.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR\fR
.ad
.RS 6n
Treats unset variables as an error when substituting.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 6n
Prints shell input lines as they are read.
.RE

.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 6n
Prints commands and their arguments as they are executed.
.RE

.sp
.LP
Using \fB+\fR rather than \fB\(mi\fR causes these flags to be turned off. These
flags can also be used upon invocation of the shell. The current set of flags
can be found in \fB$\(mi\fR. The remaining \fIargument\fRs are positional
parameters and are assigned, in order, to \fB$1\fR, \fB$2\fR,
\fB\&.\|.\|.\|.\fR If no \fIargument\fRs are specified the values of all names
are printed.
.sp
.LP
For each \fIname\fR, \fBunset\fR removes the corresponding variable or function
value. The variables \fBPATH\fR, \fBPS1\fR, \fBPS2\fR, \fBMAILCHECK\fR, and
\fBIF\fR cannot be unset.
.sp
.LP
With the \fBexport\fR built-in, the specified \fIname\fRs are marked for
automatic export to the \fIenvironment\fR of subsequently executed commands. If
no arguments are specified, variable names that have been marked for export
during the current shell's execution are listed. Function names are \fBnot\fR
exported.
.SS "csh"
.sp
.LP
With no arguments, \fBset\fR displays the values of all shell variables.
Multiword values are displayed as a parenthesized list. With the \fIvar\fR
argument alone, \fBset\fR assigns an empty (null) value to the variable
\fIvar\fR. With arguments of the form \fIvar\fR \fB=\fR \fIvalue\fR \fBset\fR
assigns \fIvalue\fR to \fIvar\fR, where \fIvalue\fR is one of:
.sp
.ne 2
.na
\fB\fIword\fR\fR
.ad
.RS 14n
A single word (or quoted string).
.RE

.sp
.ne 2
.na
\fB\fB(\fR\fIwordlist\fR\fB)\fR\fR
.ad
.RS 14n
A space-separated list of words enclosed in parentheses.
.RE

.sp
.LP
Values are command and filename expanded before being assigned. The form
\fBset\fR \fIvar\fR\fB[\fR\fIn\fR\fB]=\fR\fIword\fR replaces the \fIn\fR'th
word in a multiword value with \fIword\fR.
.sp
.LP
\fBunset\fR removes variables whose names match (filename substitution)
\fIpattern\fR. All variables are removed by `\fBunset *\fR'.
.sp
.LP
With no arguments, \fBsetenv\fR displays all environment variables. With the
\fIVAR\fR argument, \fBsetenv\fR sets the environment variable
\fB\fR\fIVAR\fR\fB \fR to an empty (null) value. (By convention, environment
variables are normally specified upper-case names.) With both \fIVAR\fR and
\fIword\fR arguments specified, \fBsetenv\fR sets \fIVAR\fR to \fIword\fR,
which must be either a single word or a quoted string. The \fBPATH\fR variable
can take multiple \fIword\fR arguments, separated by colons (see EXAMPLES). The
most commonly used environment variables, \fBUSER\fR, \fBTERM\fR, and
\fBPATH\fR, are automatically imported to and exported from the \fBcsh\fR
variables \fBuser\fR, \fBterm\fR, and \fBpath\fR. Use \fBsetenv\fR if you need
to change these variables. In addition, the shell sets the \fBPWD\fR
environment variable from the \fBcsh\fR variable \fBcwd\fR whenever the latter
changes.
.sp
.LP
The environment variables \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR,
\fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR take immediate effect
when changed within the C shell. See \fBenviron\fR(5) for descriptions of these
environment variables.
.sp
.LP
\fBunsetenv\fR removes \fIvariable\fR from the environment. As with
\fBunset\fR, pattern matching is not performed.
.SS "ksh"
.sp
.LP
The flags for the \fBset\fR built-in have meaning as follows:
.sp
.ne 2
.na
\fB\fB-A\fR\fR
.ad
.RS 13n
Array assignment. Unsets the variable \fIname\fR and assigns values
sequentially from the list \fIarg\fR. If \fB+A\fR is used, the variable
\fIname\fR is not unset first.
.RE

.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 13n
All subsequent variables that are defined are automatically exported.
.RE

.sp
.ne 2
.na
\fB\fB-b\fR\fR
.ad
.RS 13n
Causes the shell to notify the user asynchronously of background job
completions.
.RE

.sp
.ne 2
.na
\fB\fB-C\fR\fR
.ad
.RS 13n
Prevents existing files from being overwritten by the shell's \fB>\fR
redirection operator. The \fB>|\fR redirection operator overrides this
noclobber option for an individual file.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.RS 13n
If a command has a non-zero exit status, executes the \fBERR\fR trap, if set,
and exits. This mode is disabled while reading profiles.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 13n
Disables file name generation.
.RE

.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.RS 13n
Each command becomes a tracked alias when first encountered.
.RE

.sp
.ne 2
.na
\fB\fB-k\fR\fR
.ad
.RS 13n
All variable assignment arguments are placed in the environment for a command,
not just those that precede the command name.
.RE

.sp
.ne 2
.na
\fB\fB-m\fR\fR
.ad
.RS 13n
Background jobs run in a separate process group and a line prints upon
completion. The exit status of background jobs is reported in a completion
message. On systems with job control, this flag is turned on automatically for
interactive shells.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 13n
Reads commands and checks them for syntax errors, but does not execute them.
Ignored for interactive shells.
.RE

.sp
.ne 2
.na
\fB\fB+o\fR\fR
.ad
.RS 13n
Writes the current option stettings to standard output in a format that is
suitable for reinput to the shell as commands that achieve the same option
settings.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIoption\fR\fR
.ad
.RS 13n
The \fIoption\fR argument can be one of the following option names:
.sp
.ne 2
.na
\fB\fBallexport\fR\fR
.ad
.RS 14n
Same as \fB-a\fR.
.RE

.sp
.ne 2
.na
\fB\fBerrexit\fR\fR
.ad
.RS 14n
Same as \fB-e\fR.
.RE

.sp
.ne 2
.na
\fB\fBbgnice\fR\fR
.ad
.RS 14n
All background jobs are run at a lower priority. This is the default mode.
\fBemacs\fR Puts you in an \fBemacs\fR style in-line editor for command entry.
.RE

.sp
.ne 2
.na
\fB\fBgmacs\fR\fR
.ad
.RS 14n
Puts you in a \fBgmacs\fR style in-line editor for command entry.
.RE

.sp
.ne 2
.na
\fB\fBignoreeof\fR\fR
.ad
.RS 14n
The shell does not exit on end-of-file. The command \fBexit\fR must be used.
.RE

.sp
.ne 2
.na
\fB\fBkeyword\fR\fR
.ad
.RS 14n
Same as \fB-k\fR.
.RE

.sp
.ne 2
.na
\fB\fBmarkdirs\fR\fR
.ad
.RS 14n
All directory names resulting from file name generation have a trailing \fB/\fR
appended.
.RE

.sp
.ne 2
.na
\fB\fBmonitor\fR\fR
.ad
.RS 14n
Same as \fB-m\fR.
.RE

.sp
.ne 2
.na
\fB\fBnoclobber\fR\fR
.ad
.RS 14n
Prevents redirection operator \fB>\fR from truncating existing files. Requires
the \fB>|\fR operator to truncate a file when turned on. Same as \fB-C\fR.
.RE

.sp
.ne 2
.na
\fB\fBnoexec\fR\fR
.ad
.RS 14n
Same as \fB-n\fR.
.RE

.sp
.ne 2
.na
\fB\fBnoglob\fR\fR
.ad
.RS 14n
Same as \fB-f\fR.
.RE

.sp
.ne 2
.na
\fB\fBnolog\fR\fR
.ad
.RS 14n
Does not save function definitions in history file.
.RE

.sp
.ne 2
.na
\fB\fBnotify\fR\fR
.ad
.RS 14n
Same as \fB-b\fR.
.RE

.sp
.ne 2
.na
\fB\fBnounset\fR\fR
.ad
.RS 14n
Same as \fB-u\fR.
.RE

.sp
.ne 2
.na
\fB\fBprivileged\fR\fR
.ad
.RS 14n
Same as \fB-p\fR.
.RE

.sp
.ne 2
.na
\fB\fBverbose\fR\fR
.ad
.RS 14n
Same as \fB-v\fR.
.RE

.sp
.ne 2
.na
\fB\fBtrackall\fR\fR
.ad
.RS 14n
Same as \fB-h\fR.
.RE

.sp
.ne 2
.na
\fB\fBvi\fR\fR
.ad
.RS 14n
Puts you in insert mode of a \fBvi\fR style in-line editor until you hit escape
character \fB033\fR. This puts you in control mode. A return sends the line.
.RE

.sp
.ne 2
.na
\fB\fBviraw\fR\fR
.ad
.RS 14n
Each character is processed as it is typed in \fBvi\fR mode.
.RE

.sp
.ne 2
.na
\fB\fBxtrace\fR\fR
.ad
.RS 14n
Same as \fB-x\fR.
.RE

.RE

.sp
.LP
If no option name is supplied then the current option settings are printed.
.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 8n
Disables processing of the \fB$HOME/.profile\fR file and uses the file
\fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever
the effective uid is not equal to the real uid, or when the effective gid is
not equal to the real gid. Turning this off causes the effective uid and gid to
be set to the real uid and gid.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 8n
Sorts the positional parameters lexicographically.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 8n
Exits after reading and executing one command.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR\fR
.ad
.RS 8n
Treats unset parameters as an error when substituting.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 8n
Prints shell input lines as they are read.
.RE

.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 8n
Prints commands and their arguments as they are executed.
.RE

.sp
.ne 2
.na
\fB\fB\(mi\fR\fR
.ad
.RS 8n
Turns off \fB-x\fR and \fB-v\fR flags and stops examining arguments for flags.
.RE

.sp
.ne 2
.na
\fB\fB-\fR\fR
.ad
.RS 8n
Does not change any of the flags. This option is useful in setting \fB$1\fR to
a value beginning with \fB\(mi\fR\&. If no arguments follow this flag then the
positional parameters are unset.
.RE

.sp
.LP
Using \fB+\fR rather than \fB\(mi\fR causes these flags to be turned off. These
flags can also be used upon invocation of the shell. The current set of flags
can be found in \fB$\(mi\fR. Unless \fB-A\fR is specified, the remaining
arguments are positional parameters and are assigned, in order, to \fB$1\fR
\fB$2\fR .\|.\|.. If no arguments are specified then the names and values of
all variables are printed on the standard output.
.sp
.LP
The variables specified by the list of \fIname\fRs are unassigned, that is,
their values and attributes are erased. \fBreadonly\fR variables cannot be
unset. If the \fB-f\fR flag is set, then the names refer to \fBfunction\fR
names. Unsetting \fBERRNO\fR, \fBLINENO\fR, \fBMAILCHECK\fR, \fBOPTARG\fR,
\fBOPTIND\fR, \fBRANDOM\fR, \fBSECONDS\fR, \fBTMOUT\fR, and \fB_\fR removes
their special meaning even if they are subsequently assigned.
.sp
.LP
When using \fBunset\fR, the variables specified by the list of \fIname\fRs are
unassigned, i.e., their values and attributes are erased. \fBreadonly\fR
variables cannot be unset. If the \fB-f\fR, flag is set, then the names refer
to \fBfunction\fR names. Unsetting \fBERRNO\fR, \fBLINENO\fR, \fBMAILCHECK\fR,
\fBOPTARG\fR, \fBOPTIND\fR, \fBRANDOM\fR, \fBSECONDS\fR, \fBTMOUT\fR, and
\fB_\fR removes their special meaning even if they are subsequently assigned.
.sp
.LP
With the \fBexport\fR built-in, the specified \fIname\fRs are marked for
automatic export to the \fBenvironment\fR of subsequently-executed commands.
.sp
.LP
When \fB-p\fR is specified, \fBexport\fR writes to the standard output the
names and values of all exported variables in the following format:
.sp
.in +2
.nf
"export %s=%s\en", \fIname\fR, \fIvalue\fR
.fi
.in -2
.sp

.sp
.LP
if \fIname\fR is set, and:
.sp
.in +2
.nf
"export %s\en", \fIname\fR
.fi
.in -2
.sp

.sp
.LP
if \fIname\fR is unset.
.sp
.LP
The shell formats the output, including the proper use of quoting, so that it
is suitable for reinput to the shell as commands that achieve the same
exporting results, except for the following:
.RS +4
.TP
1.
Read-only variables with values cannot be reset.
.RE
.RS +4
.TP
2.
Variables that were unset at the time they were output are not reset to the
unset state if a value is assigned to the variable between the time the state
was saved and the time at which the saved output is reinput to the shell.
.RE
.sp
.LP
On this manual page, \fBksh\fR(1) commands that are preceded by one or two
\fB*\fR (asterisks) are treated specially in the following ways:
.RS +4
.TP
1.
Variable assignment lists preceding the command remain in effect when the
command completes.
.RE
.RS +4
.TP
2.
I/O redirections are processed after variable assignments.
.RE
.RS +4
.TP
3.
Errors cause a script that contains them to abort.
.RE
.RS +4
.TP
4.
Words, following a command preceded by \fB**\fR that are in the format of a
variable assignment, are expanded with the same rules as a variable assignment.
This means that tilde substitution is performed after the \fB=\fR sign and word
splitting and file name generation are not performed.
.RE
.SS "ksh93"
.sp
.LP
\fBset\fR sets or unsets options and positional parameters. Options that are
specified with a \fB-\fR cause the options to be set. Options that are
specified with a \fB+\fR cause the option to be unset.
.sp
.LP
\fBset\fR without any options or arguments displays the names and values of all
shell variables in the order of the collation sequence in the current locale.
The values are quoted so that they are suitable for input again to the shell.
.sp
.LP
If no arguments are specified, not even the end of options argument \fB--\fR,
the positional parameters are unchanged. Otherwise, unless the \fB-A\fR option
has been specified, the positional parameters are replaced by the list of
arguments. A first argument of \fB--\fR is ignored when setting positional
parameters.
.sp
.LP
For backwards compatibility, a \fBset\fR command without any options specified,
whose first argument is \fB-\fR turns off the \fB-v\fR and \fB-x\fR options. If
any additional arguments are specified, they replace the positional parameters.
.sp
.LP
The options for set in \fBksh93\fR are:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 15n
Set the export attribute for each variable whose name does not contain a . that
you assign a value in the current shell environment.
.RE

.sp
.ne 2
.na
\fB\fB-A\fR \fIname\fR\fR
.ad
.RS 15n
Assign the arguments sequentially to the array named by \fIname\fR starting at
subscript \fB0\fR rather than to the positional parameters.
.RE

.sp
.ne 2
.na
\fB\fB-b\fR\fR
.ad
.RS 15n
The shell writes a message to standard error as soon it detects that a
background job completes rather than waiting until the next prompt.
.RE

.sp
.ne 2
.na
\fB\fB-B\fR\fR
.ad
.RS 15n
Enable \fB{...}\fR group expansion. On by default.
.RE

.sp
.ne 2
.na
\fB\fB-C\fR\fR
.ad
.RS 15n
Prevents existing regular files from being overwritten using the > redirection
operator. The \fB>|\fR redirection overrides this \fBnoclobber\fR option.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.RS 15n
A simple command that has a \fBnon-zero\fR exit status causes the shell to exit
unless the simple command is:
.RS +4
.TP
.ie t \(bu
.el o
contained in an \fB&&\fR or \fB||\fR list
.RE
.RS +4
.TP
.ie t \(bu
.el o
the command immediately following \fBif\fR, \fBwhile\fR, or \fBuntil\fR
.RE
.RS +4
.TP
.ie t \(bu
.el o
contained in the pipeline following \fB!\fR
.RE
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 15n
Pathname expansion is disabled.
.RE

.sp
.ne 2
.na
\fB\fB-G\fR\fR
.ad
.RS 15n
Causes \fB**\fR by itself to also match all sub-directories during pathname
expansion.
.RE

.sp
.ne 2
.na
\fB\fB-h\fR\fR
.ad
.RS 15n
Obsolete. Causes each command whose name has the syntax of an alias to become a
tracked alias when it is first encountered.
.RE

.sp
.ne 2
.na
\fB\fB-H\fR\fR
.ad
.RS 15n
Enable \fB!\fR-style history expansion similar to csh.
.RE

.sp
.ne 2
.na
\fB\fB-k\fR\fR
.ad
.RS 15n
This is obsolete. All arguments of the form \fIname\fR\fB=\fR\fIvalue\fR are
removed and placed in the variable assignment list for the command. Ordinarily,
variable assignments must precede command arguments.
.RE

.sp
.ne 2
.na
\fB\fB-m\fR\fR
.ad
.RS 15n
When enabled, the shell runs background jobs in a separate process group and
displays a line upon completion. This mode is enabled by default for
interactive shells on systems that support job control.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 15n
The shell reads commands and checks for syntax errors, but does not execute the
command. Usually specified on command invocation.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR [\fIoption\fR]\fR
.ad
.RS 15n
If option is not specified, the list of options and their current settings is
written to standard output. When invoked with a \fB+\fR the options are written
in a format that can be input again to the shell to restore the settings. This
option can be repeated to enable or disable multiple options.
.sp
The value of \fIoption\fR must be one of the following:
.sp
.ne 2
.na
\fB\fBallexport\fR\fR
.ad
.RS 15n
Same as \fB-a\fR.
.RE

.sp
.ne 2
.na
\fB\fBbgnice\fR\fR
.ad
.RS 15n
All background jobs are run at lower priorities.
.RE

.sp
.ne 2
.na
\fB\fBbraceexpand\fR\fR
.ad
.RS 15n
Same as \fB-B\fR.
.RE

.sp
.ne 2
.na
\fB\fBemacs\fR\fR
.ad
.RS 15n
Enables or disables \fBemacs\fR editing mode.
.RE

.sp
.ne 2
.na
\fB\fBerrexit\fR\fR
.ad
.RS 15n
Same as \fB-e\fR.
.RE

.sp
.ne 2
.na
\fB\fBglobstar\fR\fR
.ad
.RS 15n
Equivalent to \fB-\fRG.
.RE

.sp
.ne 2
.na
\fB\fBgmacs\fR\fR
.ad
.RS 15n
Enables or disables \fBgmacs\fR. \fBgmacs\fR editing mode is the same as
\fBemacs\fR editing mode, except for the handling of CTRL-T.
.RE

.sp
.ne 2
.na
\fB\fBhistexpand\fR\fR
.ad
.RS 15n
Same as \fB-H\fR.
.RE

.sp
.ne 2
.na
\fB\fBignoreeof\fR\fR
.ad
.RS 15n
The interactive shell does not exit on end-of-file.
.RE

.sp
.ne 2
.na
\fB\fBkeyword\fR\fR
.ad
.RS 15n
Same as \fB-k\fR.
.RE

.sp
.ne 2
.na
\fB\fBmarkdirs\fR\fR
.ad
.RS 15n
All directory names resulting from file name generation have a trailing \fB/\fR
appended.
.RE

.sp
.ne 2
.na
\fB\fBmonitor\fR\fR
.ad
.RS 15n
Same as \fB-m\fR.
.RE

.sp
.ne 2
.na
\fB\fBmultiline\fR\fR
.ad
.RS 15n
Use multiple lines when editing lines that are longer than the window width.
.RE

.sp
.ne 2
.na
\fB\fBnoclobber\fR\fR
.ad
.RS 15n
Same as \fB-C\fR.
.RE

.sp
.ne 2
.na
\fB\fBnoexec\fR\fR
.ad
.RS 15n
Same as \fB-n\fR.
.RE

.sp
.ne 2
.na
\fB\fBnoglob\fR\fR
.ad
.RS 15n
Same as \fB-f\fR.
.RE

.sp
.ne 2
.na
\fB\fBnolog\fR\fR
.ad
.RS 15n
This has no effect. It is provided for backward compatibility.
.RE

.sp
.ne 2
.na
\fB\fBnotify\fR\fR
.ad
.RS 15n
Same as \fB-b\fR.
.RE

.sp
.ne 2
.na
\fB\fBnounset\fR\fR
.ad
.RS 15n
Same as \fB-u\fR.
.RE

.sp
.ne 2
.na
\fB\fBpipefail\fR\fR
.ad
.RS 15n
A pipeline does not complete until all components of the pipeline have
completed, and the exit status of the pipeline is the value of the last command
to exit with \fBnon-zero\fR exit status, or is \fBzero\fR if all commands
return zero exit status.
.RE

.sp
.ne 2
.na
\fB\fBprivileged\fR\fR
.ad
.RS 15n
Same as \fB-p\fR.
.RE

.sp
.ne 2
.na
\fB\fBshowme\fR\fR
.ad
.RS 15n
Simple commands preceded by a ; are traced as if \fB-x\fR were enabled but not
executed.
.RE

.sp
.ne 2
.na
\fB\fBtrackall\fR\fR
.ad
.RS 15n
Same as \fB-h\fR.
.RE

.sp
.ne 2
.na
\fB\fBverbose\fR\fR
.ad
.RS 15n
Same as \fB-v\fR.
.RE

.sp
.ne 2
.na
\fB\fBvi\fR\fR
.ad
.RS 15n
Enables or disables \fBvi\fR editing mode.
.RE

.sp
.ne 2
.na
\fB\fBviraw\fR\fR
.ad
.RS 15n
Does not use canonical input mode when using vi edit mode
.RE

.sp
.ne 2
.na
\fB\fBxtrace\fR\fR
.ad
.RS 15n
Same as \fB-x\fR.
.RE

.RE

.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 15n
Privileged mode. Disabling \fB-p\fR sets the effective user id to the real user
id, and the effective group id to the real group id. Enabling \fB-p\fR restores
the effective user and group ids to their values when the shell was invoked.
The \fB-p\fR option is on whenever the real and effective user id is not equal
or the real and effective group id is not equal. User profiles are not
processed when \fB-p\fR is enabled.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 15n
Restricted. Enables restricted shell. This option cannot be unset once enabled.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR\fR
.ad
.RS 15n
Sort the positional parameters
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 15n
Obsolete. The shell reads one command and then exits.
.RE

.sp
.ne 2
.na
\fB\fB-u\fR\fR
.ad
.RS 15n
If enabled, the shell displays an error message when it tries to expand a
variable that is unset.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 15n
Verbose. The shell displays its input onto standard error as it reads it.
.RE

.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.RS 15n
Execution trace. The shell displays each command after all expansion and before
execution preceded by the expanded value of the \fBPS4\fR parameter.
.RE

.sp
.LP
The following exit values are returned by \fBset\fR in \fBksh93\fR:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE

.sp
.LP
For each name specified, \fBunset\fR unsets the variable, or function if
\fB-f\fR is specified, from the current shell execution environment. Read-only
variables cannot be unset.
.sp
.LP
The options for \fBunset\fR in \fBksh93\fR are:
.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
Where \fIname\fR refers to a function name, the shell unsets the function
definition.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 6n
If \fIname\fR refers to variable that is a reference, the variable \fIname\fR
is unset rather than the variable it references. Otherwise, this option is
equivalent to the \fB-v\fR option.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 6n
Where \fIname\fR refers to a variable name, the shell unsets it and removes it
from the environment. This is the default behavior.
.RE

.sp
.LP
The following exit values are returned by \fBunset\fR in \fBksh93\fR:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion. All names were successfully unset.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred, or one or more \fIname\fR operands could not be unset
.RE

.sp
.LP
\fBexport\fR sets the export attribute on each of the variables specified by
name which causes them to be in the environment of subsequently executed
commands. If \fB=\fR\fIvalue\fR is specified, the variable \fIname\fR is set to
\fIvalue\fR.
.sp
.LP
If no \fIname\fR is specified, the names and values of all exported variables
are written to standard output.
.sp
.LP
\fBexport\fR is built-in to the shell as a declaration command so that field
splitting and pathname expansion are not performed on the arguments. Tilde
expansion occurs on value.
.sp
.LP
The options for \fBexport\fR in \fBksh93\fR are:
.sp
.ne 2
.na
\fB\fB-p\fR\fR
.ad
.RS 6n
Causes the output to be in the form of \fBexport\fR commands that can be used
as input to the shell to recreate the current exports.
.RE

.sp
.LP
The following exit values are returned by \fBexport\fR in \fBksh93\fR:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE

.sp
.LP
On this manual page, \fBksh93\fR(1) commands that are preceded by one or two
\fB+\fR are treated specially in the following ways:
.RS +4
.TP
1.
Variable assignment lists preceding the command remain in effect when the
command completes.
.RE
.RS +4
.TP
2.
I/O redirections are processed after variable assignments.
.RE
.RS +4
.TP
3.
Errors cause a script that contains them to abort.
.RE
.RS +4
.TP
4.
They are not valid function names.
.RE
.RS +4
.TP
5.
Words, following a command preceded by \fB++\fR that are in the format of a
variable assignment, are expanded with the same rules as a variable assignment.
This means that tilde substitution is performed after the \fB=\fR sign and
field splitting and file name generation are not performed.
.RE
.SH EXAMPLES
.SS "csh"
.sp
.LP
The following example sets the \fBPATH\fR variable to search for files in the
\fB/bin\fR, \fB/usr/bin\fR, \fB/usr/sbin\fR, and \fB/usr/ucb/bin\fR
directories, in that order:
.sp
.in +2
.nf
setenv PATH "/bin:/usr/bin:/usr/sbin:usr/ucb/bin"
.fi
.in -2
.sp

.SH SEE ALSO
.sp
.LP
\fBcsh\fR(1), \fBksh\fR(1), \fBksh93\fR(1), \fBread\fR(1), \fBsh\fR(1),
\fBtypeset\fR(1), \fBattributes\fR(5), \fBenviron\fR(5)