Unleashed v1.4
[unleashed.git] / share / man / man1 / set.1
bloba299fb438447184476c3bd53f780b7a52c4c4931
1 '\" te
2 .\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
5 .\" 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.
6 .\" 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.
7 .\" 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]
8 .TH SET 1 "Nov 20, 2007"
9 .SH NAME
10 set, unset, setenv, unsetenv, export \- shell built-in functions to determine
11 the characteristics for environmental variables of the current shell and its
12 descendents
13 .SH SYNOPSIS
14 .SS "sh"
15 .LP
16 .nf
17 \fBset\fR [\fB--aefhkntuvx\fR [\fIargument\fR]]...
18 .fi
20 .LP
21 .nf
22 \fBunset\fR [\fIname\fR]...
23 .fi
25 .LP
26 .nf
27 \fBexport\fR [\fIname\fR]...
28 .fi
30 .SS "csh"
31 .LP
32 .nf
33 \fBset\fR [\fIvar\fR [= \fIvalue\fR]]
34 .fi
36 .LP
37 .nf
38 \fBset\fR \fIvar\fR [\fIn\fR] = \fIword\fR
39 .fi
41 .LP
42 .nf
43 \fBunset\fR \fIpattern\fR
44 .fi
46 .LP
47 .nf
48 \fBsetenv\fR [\fIVAR\fR [\fIword\fR]]
49 .fi
51 .LP
52 .nf
53 \fBunsetenv\fR \fIvariable\fR
54 .fi
56 .SS "ksh"
57 .LP
58 .nf
59 \fBset\fR [\(+-abCefhkmnopstuvx] [\(+-o \fIoption\fR]... [\(+-A \fIname\fR]
60      [\fIarg\fR]...
61 .fi
63 .LP
64 .nf
65 \fBunset\fR [\fB-f\fR] \fIname\fR...
66 .fi
68 .LP
69 .nf
70 \fB**export\fR [\fIname\fR [=\fIvalue\fR]]...
71 .fi
73 .LP
74 .nf
75 \fB**export\fR [\fB-p\fR]
76 .fi
78 .SS "ksh93"
79 .LP
80 .nf
81 \fB+set\fR [\(+-abCefGhkmnoprstuvx] [\(+-o \fIoption\fR]... [\(+-A \fIvname\fR]
82      [\fIarg\fR]...
83 .fi
85 .LP
86 .nf
87 \fB+unset\fR [\fB-fnv\fR] \fIvname\fR...
88 .fi
90 .LP
91 .nf
92 \fB++export\fR [\fB-p\fR] [\fIname\fR[=\fIvalue\fR]]...
93 .fi
95 .SH DESCRIPTION
96 .SS "sh"
97 .LP
98 The \fBset\fR built-in command has the following options:
99 .sp
100 .ne 2
102 \fB\fB--\fR\fR
104 .RS 6n
105 Does not change any of the flags. This option is useful in setting \fB$1\fR to
106 \fB\(mi\fR\&.
110 .ne 2
112 \fB\fB-a\fR\fR
114 .RS 6n
115 Marks variables which are modified or created for export.
119 .ne 2
121 \fB\fB-e\fR\fR
123 .RS 6n
124 Exits immediately if a command exits with a non-zero exit status.
128 .ne 2
130 \fB\fB-f\fR\fR
132 .RS 6n
133 Disables file name generation.
137 .ne 2
139 \fB\fB-h\fR\fR
141 .RS 6n
142 Locates and remembers function commands as functions are defined. Function
143 commands are normally located when the function is executed.
147 .ne 2
149 \fB\fB-k\fR\fR
151 .RS 6n
152 All keyword arguments are placed in the environment for a command, not just
153 those that precede the command name.
157 .ne 2
159 \fB\fB-n\fR\fR
161 .RS 6n
162 Reads commands but does not execute them.
166 .ne 2
168 \fB\fB-t\fR\fR
170 .RS 6n
171 Exits after reading and executing one command.
175 .ne 2
177 \fB\fB-u\fR\fR
179 .RS 6n
180 Treats unset variables as an error when substituting.
184 .ne 2
186 \fB\fB-v\fR\fR
188 .RS 6n
189 Prints shell input lines as they are read.
193 .ne 2
195 \fB\fB-x\fR\fR
197 .RS 6n
198 Prints commands and their arguments as they are executed.
203 Using \fB+\fR rather than \fB\(mi\fR causes these flags to be turned off. These
204 flags can also be used upon invocation of the shell. The current set of flags
205 can be found in \fB$\(mi\fR. The remaining \fIargument\fRs are positional
206 parameters and are assigned, in order, to \fB$1\fR, \fB$2\fR,
207 \fB\&.\|.\|.\|.\fR If no \fIargument\fRs are specified the values of all names
208 are printed.
211 For each \fIname\fR, \fBunset\fR removes the corresponding variable or function
212 value. The variables \fBPATH\fR, \fBPS1\fR, \fBPS2\fR, \fBMAILCHECK\fR, and
213 \fBIF\fR cannot be unset.
216 With the \fBexport\fR built-in, the specified \fIname\fRs are marked for
217 automatic export to the \fIenvironment\fR of subsequently executed commands. If
218 no arguments are specified, variable names that have been marked for export
219 during the current shell's execution are listed. Function names are \fBnot\fR
220 exported.
221 .SS "csh"
223 With no arguments, \fBset\fR displays the values of all shell variables.
224 Multiword values are displayed as a parenthesized list. With the \fIvar\fR
225 argument alone, \fBset\fR assigns an empty (null) value to the variable
226 \fIvar\fR. With arguments of the form \fIvar\fR \fB=\fR \fIvalue\fR \fBset\fR
227 assigns \fIvalue\fR to \fIvar\fR, where \fIvalue\fR is one of:
229 .ne 2
231 \fB\fIword\fR\fR
233 .RS 14n
234 A single word (or quoted string).
238 .ne 2
240 \fB\fB(\fR\fIwordlist\fR\fB)\fR\fR
242 .RS 14n
243 A space-separated list of words enclosed in parentheses.
248 Values are command and filename expanded before being assigned. The form
249 \fBset\fR \fIvar\fR\fB[\fR\fIn\fR\fB]=\fR\fIword\fR replaces the \fIn\fR'th
250 word in a multiword value with \fIword\fR.
253 \fBunset\fR removes variables whose names match (filename substitution)
254 \fIpattern\fR. All variables are removed by `\fBunset *\fR'.
257 With no arguments, \fBsetenv\fR displays all environment variables. With the
258 \fIVAR\fR argument, \fBsetenv\fR sets the environment variable
259 \fB\fR\fIVAR\fR\fB \fR to an empty (null) value. (By convention, environment
260 variables are normally specified upper-case names.) With both \fIVAR\fR and
261 \fIword\fR arguments specified, \fBsetenv\fR sets \fIVAR\fR to \fIword\fR,
262 which must be either a single word or a quoted string. The \fBPATH\fR variable
263 can take multiple \fIword\fR arguments, separated by colons (see EXAMPLES). The
264 most commonly used environment variables, \fBUSER\fR, \fBTERM\fR, and
265 \fBPATH\fR, are automatically imported to and exported from the \fBcsh\fR
266 variables \fBuser\fR, \fBterm\fR, and \fBpath\fR. Use \fBsetenv\fR if you need
267 to change these variables. In addition, the shell sets the \fBPWD\fR
268 environment variable from the \fBcsh\fR variable \fBcwd\fR whenever the latter
269 changes.
272 The environment variables \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR,
273 \fBLC_COLLATE\fR, \fBLC_NUMERIC\fR, and \fBLC_MONETARY\fR take immediate effect
274 when changed within the C shell. See \fBenviron\fR(5) for descriptions of these
275 environment variables.
278 \fBunsetenv\fR removes \fIvariable\fR from the environment. As with
279 \fBunset\fR, pattern matching is not performed.
280 .SS "ksh"
282 The flags for the \fBset\fR built-in have meaning as follows:
284 .ne 2
286 \fB\fB-A\fR\fR
288 .RS 13n
289 Array assignment. Unsets the variable \fIname\fR and assigns values
290 sequentially from the list \fIarg\fR. If \fB+A\fR is used, the variable
291 \fIname\fR is not unset first.
295 .ne 2
297 \fB\fB-a\fR\fR
299 .RS 13n
300 All subsequent variables that are defined are automatically exported.
304 .ne 2
306 \fB\fB-b\fR\fR
308 .RS 13n
309 Causes the shell to notify the user asynchronously of background job
310 completions.
314 .ne 2
316 \fB\fB-C\fR\fR
318 .RS 13n
319 Prevents existing files from being overwritten by the shell's \fB>\fR
320 redirection operator. The \fB>|\fR redirection operator overrides this
321 noclobber option for an individual file.
325 .ne 2
327 \fB\fB-e\fR\fR
329 .RS 13n
330 If a command has a non-zero exit status, executes the \fBERR\fR trap, if set,
331 and exits. This mode is disabled while reading profiles.
335 .ne 2
337 \fB\fB-f\fR\fR
339 .RS 13n
340 Disables file name generation.
344 .ne 2
346 \fB\fB-h\fR\fR
348 .RS 13n
349 Each command becomes a tracked alias when first encountered.
353 .ne 2
355 \fB\fB-k\fR\fR
357 .RS 13n
358 All variable assignment arguments are placed in the environment for a command,
359 not just those that precede the command name.
363 .ne 2
365 \fB\fB-m\fR\fR
367 .RS 13n
368 Background jobs run in a separate process group and a line prints upon
369 completion. The exit status of background jobs is reported in a completion
370 message. On systems with job control, this flag is turned on automatically for
371 interactive shells.
375 .ne 2
377 \fB\fB-n\fR\fR
379 .RS 13n
380 Reads commands and checks them for syntax errors, but does not execute them.
381 Ignored for interactive shells.
385 .ne 2
387 \fB\fB+o\fR\fR
389 .RS 13n
390 Writes the current option settings to standard output in a format that is
391 suitable for reinput to the shell as commands that achieve the same option
392 settings.
396 .ne 2
398 \fB\fB-o\fR \fIoption\fR\fR
400 .RS 13n
401 The \fIoption\fR argument can be one of the following option names:
403 .ne 2
405 \fB\fBallexport\fR\fR
407 .RS 14n
408 Same as \fB-a\fR.
412 .ne 2
414 \fB\fBerrexit\fR\fR
416 .RS 14n
417 Same as \fB-e\fR.
421 .ne 2
423 \fB\fBbgnice\fR\fR
425 .RS 14n
426 All background jobs are run at a lower priority. This is the default mode.
427 \fBemacs\fR Puts you in an \fBemacs\fR style in-line editor for command entry.
431 .ne 2
433 \fB\fBgmacs\fR\fR
435 .RS 14n
436 Puts you in a \fBgmacs\fR style in-line editor for command entry.
440 .ne 2
442 \fB\fBignoreeof\fR\fR
444 .RS 14n
445 The shell does not exit on end-of-file. The command \fBexit\fR must be used.
449 .ne 2
451 \fB\fBkeyword\fR\fR
453 .RS 14n
454 Same as \fB-k\fR.
458 .ne 2
460 \fB\fBmarkdirs\fR\fR
462 .RS 14n
463 All directory names resulting from file name generation have a trailing \fB/\fR
464 appended.
468 .ne 2
470 \fB\fBmonitor\fR\fR
472 .RS 14n
473 Same as \fB-m\fR.
477 .ne 2
479 \fB\fBnoclobber\fR\fR
481 .RS 14n
482 Prevents redirection operator \fB>\fR from truncating existing files. Requires
483 the \fB>|\fR operator to truncate a file when turned on. Same as \fB-C\fR.
487 .ne 2
489 \fB\fBnoexec\fR\fR
491 .RS 14n
492 Same as \fB-n\fR.
496 .ne 2
498 \fB\fBnoglob\fR\fR
500 .RS 14n
501 Same as \fB-f\fR.
505 .ne 2
507 \fB\fBnolog\fR\fR
509 .RS 14n
510 Does not save function definitions in history file.
514 .ne 2
516 \fB\fBnotify\fR\fR
518 .RS 14n
519 Same as \fB-b\fR.
523 .ne 2
525 \fB\fBnounset\fR\fR
527 .RS 14n
528 Same as \fB-u\fR.
532 .ne 2
534 \fB\fBprivileged\fR\fR
536 .RS 14n
537 Same as \fB-p\fR.
541 .ne 2
543 \fB\fBverbose\fR\fR
545 .RS 14n
546 Same as \fB-v\fR.
550 .ne 2
552 \fB\fBtrackall\fR\fR
554 .RS 14n
555 Same as \fB-h\fR.
559 .ne 2
561 \fB\fBvi\fR\fR
563 .RS 14n
564 Puts you in insert mode of a \fBvi\fR style in-line editor until you hit escape
565 character \fB033\fR. This puts you in control mode. A return sends the line.
569 .ne 2
571 \fB\fBviraw\fR\fR
573 .RS 14n
574 Each character is processed as it is typed in \fBvi\fR mode.
578 .ne 2
580 \fB\fBxtrace\fR\fR
582 .RS 14n
583 Same as \fB-x\fR.
590 If no option name is supplied then the current option settings are printed.
592 .ne 2
594 \fB\fB-p\fR\fR
596 .RS 8n
597 Disables processing of the \fB$HOME/.profile\fR file and uses the file
598 \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever
599 the effective uid is not equal to the real uid, or when the effective gid is
600 not equal to the real gid. Turning this off causes the effective uid and gid to
601 be set to the real uid and gid.
605 .ne 2
607 \fB\fB-s\fR\fR
609 .RS 8n
610 Sorts the positional parameters lexicographically.
614 .ne 2
616 \fB\fB-t\fR\fR
618 .RS 8n
619 Exits after reading and executing one command.
623 .ne 2
625 \fB\fB-u\fR\fR
627 .RS 8n
628 Treats unset parameters as an error when substituting.
632 .ne 2
634 \fB\fB-v\fR\fR
636 .RS 8n
637 Prints shell input lines as they are read.
641 .ne 2
643 \fB\fB-x\fR\fR
645 .RS 8n
646 Prints commands and their arguments as they are executed.
650 .ne 2
652 \fB\fB\(mi\fR\fR
654 .RS 8n
655 Turns off \fB-x\fR and \fB-v\fR flags and stops examining arguments for flags.
659 .ne 2
661 \fB\fB-\fR\fR
663 .RS 8n
664 Does not change any of the flags. This option is useful in setting \fB$1\fR to
665 a value beginning with \fB\(mi\fR\&. If no arguments follow this flag then the
666 positional parameters are unset.
671 Using \fB+\fR rather than \fB\(mi\fR causes these flags to be turned off. These
672 flags can also be used upon invocation of the shell. The current set of flags
673 can be found in \fB$\(mi\fR. Unless \fB-A\fR is specified, the remaining
674 arguments are positional parameters and are assigned, in order, to \fB$1\fR
675 \fB$2\fR .\|.\|.. If no arguments are specified then the names and values of
676 all variables are printed on the standard output.
679 The variables specified by the list of \fIname\fRs are unassigned, that is,
680 their values and attributes are erased. \fBreadonly\fR variables cannot be
681 unset. If the \fB-f\fR flag is set, then the names refer to \fBfunction\fR
682 names. Unsetting \fBERRNO\fR, \fBLINENO\fR, \fBMAILCHECK\fR, \fBOPTARG\fR,
683 \fBOPTIND\fR, \fBRANDOM\fR, \fBSECONDS\fR, \fBTMOUT\fR, and \fB_\fR removes
684 their special meaning even if they are subsequently assigned.
687 When using \fBunset\fR, the variables specified by the list of \fIname\fRs are
688 unassigned, i.e., their values and attributes are erased. \fBreadonly\fR
689 variables cannot be unset. If the \fB-f\fR, flag is set, then the names refer
690 to \fBfunction\fR names. Unsetting \fBERRNO\fR, \fBLINENO\fR, \fBMAILCHECK\fR,
691 \fBOPTARG\fR, \fBOPTIND\fR, \fBRANDOM\fR, \fBSECONDS\fR, \fBTMOUT\fR, and
692 \fB_\fR removes their special meaning even if they are subsequently assigned.
695 With the \fBexport\fR built-in, the specified \fIname\fRs are marked for
696 automatic export to the \fBenvironment\fR of subsequently-executed commands.
699 When \fB-p\fR is specified, \fBexport\fR writes to the standard output the
700 names and values of all exported variables in the following format:
702 .in +2
704 "export %s=%s\en", \fIname\fR, \fIvalue\fR
706 .in -2
711 if \fIname\fR is set, and:
713 .in +2
715 "export %s\en", \fIname\fR
717 .in -2
722 if \fIname\fR is unset.
725 The shell formats the output, including the proper use of quoting, so that it
726 is suitable for reinput to the shell as commands that achieve the same
727 exporting results, except for the following:
728 .RS +4
731 Read-only variables with values cannot be reset.
733 .RS +4
736 Variables that were unset at the time they were output are not reset to the
737 unset state if a value is assigned to the variable between the time the state
738 was saved and the time at which the saved output is reinput to the shell.
742 On this manual page, \fBksh\fR(1) commands that are preceded by one or two
743 \fB*\fR (asterisks) are treated specially in the following ways:
744 .RS +4
747 Variable assignment lists preceding the command remain in effect when the
748 command completes.
750 .RS +4
753 I/O redirections are processed after variable assignments.
755 .RS +4
758 Errors cause a script that contains them to abort.
760 .RS +4
763 Words, following a command preceded by \fB**\fR that are in the format of a
764 variable assignment, are expanded with the same rules as a variable assignment.
765 This means that tilde substitution is performed after the \fB=\fR sign and word
766 splitting and file name generation are not performed.
768 .SS "ksh93"
770 \fBset\fR sets or unsets options and positional parameters. Options that are
771 specified with a \fB-\fR cause the options to be set. Options that are
772 specified with a \fB+\fR cause the option to be unset.
775 \fBset\fR without any options or arguments displays the names and values of all
776 shell variables in the order of the collation sequence in the current locale.
777 The values are quoted so that they are suitable for input again to the shell.
780 If no arguments are specified, not even the end of options argument \fB--\fR,
781 the positional parameters are unchanged. Otherwise, unless the \fB-A\fR option
782 has been specified, the positional parameters are replaced by the list of
783 arguments. A first argument of \fB--\fR is ignored when setting positional
784 parameters.
787 For backwards compatibility, a \fBset\fR command without any options specified,
788 whose first argument is \fB-\fR turns off the \fB-v\fR and \fB-x\fR options. If
789 any additional arguments are specified, they replace the positional parameters.
792 The options for set in \fBksh93\fR are:
794 .ne 2
796 \fB\fB-a\fR\fR
798 .RS 15n
799 Set the export attribute for each variable whose name does not contain a . that
800 you assign a value in the current shell environment.
804 .ne 2
806 \fB\fB-A\fR \fIname\fR\fR
808 .RS 15n
809 Assign the arguments sequentially to the array named by \fIname\fR starting at
810 subscript \fB0\fR rather than to the positional parameters.
814 .ne 2
816 \fB\fB-b\fR\fR
818 .RS 15n
819 The shell writes a message to standard error as soon it detects that a
820 background job completes rather than waiting until the next prompt.
824 .ne 2
826 \fB\fB-B\fR\fR
828 .RS 15n
829 Enable \fB{...}\fR group expansion. On by default.
833 .ne 2
835 \fB\fB-C\fR\fR
837 .RS 15n
838 Prevents existing regular files from being overwritten using the > redirection
839 operator. The \fB>|\fR redirection overrides this \fBnoclobber\fR option.
843 .ne 2
845 \fB\fB-e\fR\fR
847 .RS 15n
848 A simple command that has a \fBnon-zero\fR exit status causes the shell to exit
849 unless the simple command is:
850 .RS +4
852 .ie t \(bu
853 .el o
854 contained in an \fB&&\fR or \fB||\fR list
856 .RS +4
858 .ie t \(bu
859 .el o
860 the command immediately following \fBif\fR, \fBwhile\fR, or \fBuntil\fR
862 .RS +4
864 .ie t \(bu
865 .el o
866 contained in the pipeline following \fB!\fR
871 .ne 2
873 \fB\fB-f\fR\fR
875 .RS 15n
876 Pathname expansion is disabled.
880 .ne 2
882 \fB\fB-G\fR\fR
884 .RS 15n
885 Causes \fB**\fR by itself to also match all sub-directories during pathname
886 expansion.
890 .ne 2
892 \fB\fB-h\fR\fR
894 .RS 15n
895 Obsolete. Causes each command whose name has the syntax of an alias to become a
896 tracked alias when it is first encountered.
900 .ne 2
902 \fB\fB-H\fR\fR
904 .RS 15n
905 Enable \fB!\fR-style history expansion similar to csh.
909 .ne 2
911 \fB\fB-k\fR\fR
913 .RS 15n
914 This is obsolete. All arguments of the form \fIname\fR\fB=\fR\fIvalue\fR are
915 removed and placed in the variable assignment list for the command. Ordinarily,
916 variable assignments must precede command arguments.
920 .ne 2
922 \fB\fB-m\fR\fR
924 .RS 15n
925 When enabled, the shell runs background jobs in a separate process group and
926 displays a line upon completion. This mode is enabled by default for
927 interactive shells on systems that support job control.
931 .ne 2
933 \fB\fB-n\fR\fR
935 .RS 15n
936 The shell reads commands and checks for syntax errors, but does not execute the
937 command. Usually specified on command invocation.
941 .ne 2
943 \fB\fB-o\fR [\fIoption\fR]\fR
945 .RS 15n
946 If option is not specified, the list of options and their current settings is
947 written to standard output. When invoked with a \fB+\fR the options are written
948 in a format that can be input again to the shell to restore the settings. This
949 option can be repeated to enable or disable multiple options.
951 The value of \fIoption\fR must be one of the following:
953 .ne 2
955 \fB\fBallexport\fR\fR
957 .RS 15n
958 Same as \fB-a\fR.
962 .ne 2
964 \fB\fBbgnice\fR\fR
966 .RS 15n
967 All background jobs are run at lower priorities.
971 .ne 2
973 \fB\fBbraceexpand\fR\fR
975 .RS 15n
976 Same as \fB-B\fR.
980 .ne 2
982 \fB\fBemacs\fR\fR
984 .RS 15n
985 Enables or disables \fBemacs\fR editing mode.
989 .ne 2
991 \fB\fBerrexit\fR\fR
993 .RS 15n
994 Same as \fB-e\fR.
998 .ne 2
1000 \fB\fBglobstar\fR\fR
1002 .RS 15n
1003 Equivalent to \fB-\fRG.
1007 .ne 2
1009 \fB\fBgmacs\fR\fR
1011 .RS 15n
1012 Enables or disables \fBgmacs\fR. \fBgmacs\fR editing mode is the same as
1013 \fBemacs\fR editing mode, except for the handling of CTRL-T.
1017 .ne 2
1019 \fB\fBhistexpand\fR\fR
1021 .RS 15n
1022 Same as \fB-H\fR.
1026 .ne 2
1028 \fB\fBignoreeof\fR\fR
1030 .RS 15n
1031 The interactive shell does not exit on end-of-file.
1035 .ne 2
1037 \fB\fBkeyword\fR\fR
1039 .RS 15n
1040 Same as \fB-k\fR.
1044 .ne 2
1046 \fB\fBmarkdirs\fR\fR
1048 .RS 15n
1049 All directory names resulting from file name generation have a trailing \fB/\fR
1050 appended.
1054 .ne 2
1056 \fB\fBmonitor\fR\fR
1058 .RS 15n
1059 Same as \fB-m\fR.
1063 .ne 2
1065 \fB\fBmultiline\fR\fR
1067 .RS 15n
1068 Use multiple lines when editing lines that are longer than the window width.
1072 .ne 2
1074 \fB\fBnoclobber\fR\fR
1076 .RS 15n
1077 Same as \fB-C\fR.
1081 .ne 2
1083 \fB\fBnoexec\fR\fR
1085 .RS 15n
1086 Same as \fB-n\fR.
1090 .ne 2
1092 \fB\fBnoglob\fR\fR
1094 .RS 15n
1095 Same as \fB-f\fR.
1099 .ne 2
1101 \fB\fBnolog\fR\fR
1103 .RS 15n
1104 This has no effect. It is provided for backward compatibility.
1108 .ne 2
1110 \fB\fBnotify\fR\fR
1112 .RS 15n
1113 Same as \fB-b\fR.
1117 .ne 2
1119 \fB\fBnounset\fR\fR
1121 .RS 15n
1122 Same as \fB-u\fR.
1126 .ne 2
1128 \fB\fBpipefail\fR\fR
1130 .RS 15n
1131 A pipeline does not complete until all components of the pipeline have
1132 completed, and the exit status of the pipeline is the value of the last command
1133 to exit with \fBnon-zero\fR exit status, or is \fBzero\fR if all commands
1134 return zero exit status.
1138 .ne 2
1140 \fB\fBprivileged\fR\fR
1142 .RS 15n
1143 Same as \fB-p\fR.
1147 .ne 2
1149 \fB\fBshowme\fR\fR
1151 .RS 15n
1152 Simple commands preceded by a ; are traced as if \fB-x\fR were enabled but not
1153 executed.
1157 .ne 2
1159 \fB\fBtrackall\fR\fR
1161 .RS 15n
1162 Same as \fB-h\fR.
1166 .ne 2
1168 \fB\fBverbose\fR\fR
1170 .RS 15n
1171 Same as \fB-v\fR.
1175 .ne 2
1177 \fB\fBvi\fR\fR
1179 .RS 15n
1180 Enables or disables \fBvi\fR editing mode.
1184 .ne 2
1186 \fB\fBviraw\fR\fR
1188 .RS 15n
1189 Does not use canonical input mode when using vi edit mode
1193 .ne 2
1195 \fB\fBxtrace\fR\fR
1197 .RS 15n
1198 Same as \fB-x\fR.
1204 .ne 2
1206 \fB\fB-p\fR\fR
1208 .RS 15n
1209 Privileged mode. Disabling \fB-p\fR sets the effective user id to the real user
1210 id, and the effective group id to the real group id. Enabling \fB-p\fR restores
1211 the effective user and group ids to their values when the shell was invoked.
1212 The \fB-p\fR option is on whenever the real and effective user id is not equal
1213 or the real and effective group id is not equal. User profiles are not
1214 processed when \fB-p\fR is enabled.
1218 .ne 2
1220 \fB\fB-r\fR\fR
1222 .RS 15n
1223 Restricted. Enables restricted shell. This option cannot be unset once enabled.
1227 .ne 2
1229 \fB\fB-s\fR\fR
1231 .RS 15n
1232 Sort the positional parameters
1236 .ne 2
1238 \fB\fB-t\fR\fR
1240 .RS 15n
1241 Obsolete. The shell reads one command and then exits.
1245 .ne 2
1247 \fB\fB-u\fR\fR
1249 .RS 15n
1250 If enabled, the shell displays an error message when it tries to expand a
1251 variable that is unset.
1255 .ne 2
1257 \fB\fB-v\fR\fR
1259 .RS 15n
1260 Verbose. The shell displays its input onto standard error as it reads it.
1264 .ne 2
1266 \fB\fB-x\fR\fR
1268 .RS 15n
1269 Execution trace. The shell displays each command after all expansion and before
1270 execution preceded by the expanded value of the \fBPS4\fR parameter.
1275 The following exit values are returned by \fBset\fR in \fBksh93\fR:
1277 .ne 2
1279 \fB\fB0\fR\fR
1281 .RS 6n
1282 Successful completion.
1286 .ne 2
1288 \fB\fB>0\fR\fR
1290 .RS 6n
1291 An error occurred.
1296 For each name specified, \fBunset\fR unsets the variable, or function if
1297 \fB-f\fR is specified, from the current shell execution environment. Read-only
1298 variables cannot be unset.
1301 The options for \fBunset\fR in \fBksh93\fR are:
1303 .ne 2
1305 \fB\fB-f\fR\fR
1307 .RS 6n
1308 Where \fIname\fR refers to a function name, the shell unsets the function
1309 definition.
1313 .ne 2
1315 \fB\fB-n\fR\fR
1317 .RS 6n
1318 If \fIname\fR refers to variable that is a reference, the variable \fIname\fR
1319 is unset rather than the variable it references. Otherwise, this option is
1320 equivalent to the \fB-v\fR option.
1324 .ne 2
1326 \fB\fB-v\fR\fR
1328 .RS 6n
1329 Where \fIname\fR refers to a variable name, the shell unsets it and removes it
1330 from the environment. This is the default behavior.
1335 The following exit values are returned by \fBunset\fR in \fBksh93\fR:
1337 .ne 2
1339 \fB\fB0\fR\fR
1341 .RS 6n
1342 Successful completion. All names were successfully unset.
1346 .ne 2
1348 \fB\fB>0\fR\fR
1350 .RS 6n
1351 An error occurred, or one or more \fIname\fR operands could not be unset
1356 \fBexport\fR sets the export attribute on each of the variables specified by
1357 name which causes them to be in the environment of subsequently executed
1358 commands. If \fB=\fR\fIvalue\fR is specified, the variable \fIname\fR is set to
1359 \fIvalue\fR.
1362 If no \fIname\fR is specified, the names and values of all exported variables
1363 are written to standard output.
1366 \fBexport\fR is built-in to the shell as a declaration command so that field
1367 splitting and pathname expansion are not performed on the arguments. Tilde
1368 expansion occurs on value.
1371 The options for \fBexport\fR in \fBksh93\fR are:
1373 .ne 2
1375 \fB\fB-p\fR\fR
1377 .RS 6n
1378 Causes the output to be in the form of \fBexport\fR commands that can be used
1379 as input to the shell to recreate the current exports.
1384 The following exit values are returned by \fBexport\fR in \fBksh93\fR:
1386 .ne 2
1388 \fB\fB0\fR\fR
1390 .RS 6n
1391 Successful completion.
1395 .ne 2
1397 \fB\fB>0\fR\fR
1399 .RS 6n
1400 An error occurred.
1405 On this manual page, \fBksh93\fR(1) commands that are preceded by one or two
1406 \fB+\fR are treated specially in the following ways:
1407 .RS +4
1410 Variable assignment lists preceding the command remain in effect when the
1411 command completes.
1413 .RS +4
1416 I/O redirections are processed after variable assignments.
1418 .RS +4
1421 Errors cause a script that contains them to abort.
1423 .RS +4
1426 They are not valid function names.
1428 .RS +4
1431 Words, following a command preceded by \fB++\fR that are in the format of a
1432 variable assignment, are expanded with the same rules as a variable assignment.
1433 This means that tilde substitution is performed after the \fB=\fR sign and
1434 field splitting and file name generation are not performed.
1436 .SH EXAMPLES
1437 .SS "csh"
1439 The following example sets the \fBPATH\fR variable to search for files in the
1440 \fB/bin\fR, \fB/usr/bin\fR, and \fB/usr/sbin\fR
1441 directories, in that order:
1443 .in +2
1445 setenv PATH "/bin:/usr/bin:/usr/sbin"
1447 .in -2
1450 .SH SEE ALSO
1452 \fBcsh\fR(1), \fBksh\fR(1), \fBksh93\fR(1), \fBread\fR(1), \fBsh\fR(1),
1453 \fBtypeset\fR(1), \fBattributes\fR(5), \fBenviron\fR(5)