|
Packit |
7cfc04 |
'\" et
|
|
Packit |
7cfc04 |
.TH UNSET "1P" 2013 "IEEE/The Open Group" "POSIX Programmer's Manual"
|
|
Packit |
7cfc04 |
.SH PROLOG
|
|
Packit |
7cfc04 |
This manual page is part of the POSIX Programmer's Manual.
|
|
Packit |
7cfc04 |
The Linux implementation of this interface may differ (consult
|
|
Packit |
7cfc04 |
the corresponding Linux manual page for details of Linux behavior),
|
|
Packit |
7cfc04 |
or the interface may not be implemented on Linux.
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
.SH NAME
|
|
Packit |
7cfc04 |
unset
|
|
Packit |
7cfc04 |
\(em unset values and attributes of variables and functions
|
|
Packit |
7cfc04 |
.SH SYNOPSIS
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
unset \fB[\fR\(mifv\fB] \fIname\fR...
|
|
Packit |
7cfc04 |
.fi
|
|
Packit |
7cfc04 |
.SH DESCRIPTION
|
|
Packit |
7cfc04 |
Each variable or function specified by
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
shall be unset.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.BR \(miv
|
|
Packit |
7cfc04 |
is specified,
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
refers to a variable name and the shell shall unset it and remove it
|
|
Packit |
7cfc04 |
from the environment. Read-only variables cannot be unset.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
is specified,
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
refers to a function and the shell shall unset the function definition.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
If neither
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
nor
|
|
Packit |
7cfc04 |
.BR \(miv
|
|
Packit |
7cfc04 |
is specified,
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
refers to a variable; if a variable by that name does not exist, it is
|
|
Packit |
7cfc04 |
unspecified whether a function by that name, if any, shall be unset.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Unsetting a variable or function that was not previously set shall not
|
|
Packit |
7cfc04 |
be considered an error and does not cause the shell to abort.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.IR unset
|
|
Packit |
7cfc04 |
special built-in shall support the Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "Section 12.2" ", " "Utility Syntax Guidelines".
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Note that:
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
VARIABLE=
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
is not equivalent to an
|
|
Packit |
7cfc04 |
.IR unset
|
|
Packit |
7cfc04 |
of
|
|
Packit |
7cfc04 |
.BR VARIABLE ;
|
|
Packit |
7cfc04 |
in the example,
|
|
Packit |
7cfc04 |
.BR VARIABLE
|
|
Packit |
7cfc04 |
is set to
|
|
Packit |
7cfc04 |
.BR \(dq\^\(dq .
|
|
Packit |
7cfc04 |
Also, the variables that can be
|
|
Packit |
7cfc04 |
.IR unset
|
|
Packit |
7cfc04 |
should not be misinterpreted to include the special parameters (see
|
|
Packit |
7cfc04 |
.IR "Section 2.5.2" ", " "Special Parameters").
|
|
Packit |
7cfc04 |
.SH OPTIONS
|
|
Packit |
7cfc04 |
See the DESCRIPTION.
|
|
Packit |
7cfc04 |
.SH OPERANDS
|
|
Packit |
7cfc04 |
See the DESCRIPTION.
|
|
Packit |
7cfc04 |
.SH STDIN
|
|
Packit |
7cfc04 |
Not used.
|
|
Packit |
7cfc04 |
.SH "INPUT FILES"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "ENVIRONMENT VARIABLES"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "ASYNCHRONOUS EVENTS"
|
|
Packit |
7cfc04 |
Default.
|
|
Packit |
7cfc04 |
.SH STDOUT
|
|
Packit |
7cfc04 |
Not used.
|
|
Packit |
7cfc04 |
.SH STDERR
|
|
Packit |
7cfc04 |
The standard error shall be used only for diagnostic messages.
|
|
Packit |
7cfc04 |
.SH "OUTPUT FILES"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "EXTENDED DESCRIPTION"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "EXIT STATUS"
|
|
Packit |
7cfc04 |
.IP "\00" 6
|
|
Packit |
7cfc04 |
All
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
operands were successfully unset.
|
|
Packit |
7cfc04 |
.IP >0 6
|
|
Packit |
7cfc04 |
At least one
|
|
Packit |
7cfc04 |
.IR name
|
|
Packit |
7cfc04 |
could not be unset.
|
|
Packit |
7cfc04 |
.SH "CONSEQUENCES OF ERRORS"
|
|
Packit |
7cfc04 |
Default.
|
|
Packit |
7cfc04 |
.LP
|
|
Packit |
7cfc04 |
.IR "The following sections are informative."
|
|
Packit |
7cfc04 |
.SH "APPLICATION USAGE"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH EXAMPLES
|
|
Packit |
7cfc04 |
Unset
|
|
Packit |
7cfc04 |
.IR VISUAL
|
|
Packit |
7cfc04 |
variable:
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
unset \(miv VISUAL
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
Unset the functions
|
|
Packit |
7cfc04 |
.BR foo
|
|
Packit |
7cfc04 |
and
|
|
Packit |
7cfc04 |
.BR bar :
|
|
Packit |
7cfc04 |
.sp
|
|
Packit |
7cfc04 |
.RS 4
|
|
Packit |
7cfc04 |
.nf
|
|
Packit |
7cfc04 |
\fB
|
|
Packit |
7cfc04 |
unset \(mif foo bar
|
|
Packit |
7cfc04 |
.fi \fR
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
.RE
|
|
Packit |
7cfc04 |
.SH "RATIONALE"
|
|
Packit |
7cfc04 |
Consideration was given to omitting the
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
option in favor of an
|
|
Packit |
7cfc04 |
.IR unfunction
|
|
Packit |
7cfc04 |
utility, but the standard developers decided to retain historical
|
|
Packit |
7cfc04 |
practice.
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The
|
|
Packit |
7cfc04 |
.BR \(miv
|
|
Packit |
7cfc04 |
option was introduced because System V historically used one name space
|
|
Packit |
7cfc04 |
for both variables and functions. When
|
|
Packit |
7cfc04 |
.IR unset
|
|
Packit |
7cfc04 |
is used without options, System V historically unset either a function
|
|
Packit |
7cfc04 |
or a variable, and there was no confusion about which one was intended.
|
|
Packit |
7cfc04 |
A portable POSIX application can use
|
|
Packit |
7cfc04 |
.IR unset
|
|
Packit |
7cfc04 |
without an option to unset a variable, but not a function; the
|
|
Packit |
7cfc04 |
.BR \(mif
|
|
Packit |
7cfc04 |
option must be used.
|
|
Packit |
7cfc04 |
.SH "FUTURE DIRECTIONS"
|
|
Packit |
7cfc04 |
None.
|
|
Packit |
7cfc04 |
.SH "SEE ALSO"
|
|
Packit |
7cfc04 |
.IR "Section 2.14" ", " "Special Built-In Utilities"
|
|
Packit |
7cfc04 |
.P
|
|
Packit |
7cfc04 |
The Base Definitions volume of POSIX.1\(hy2008,
|
|
Packit |
7cfc04 |
.IR "Section 12.2" ", " "Utility Syntax Guidelines"
|
|
Packit |
7cfc04 |
.SH COPYRIGHT
|
|
Packit |
7cfc04 |
Portions of this text are reprinted and reproduced in electronic form
|
|
Packit |
7cfc04 |
from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
|
|
Packit |
7cfc04 |
-- Portable Operating System Interface (POSIX), The Open Group Base
|
|
Packit |
7cfc04 |
Specifications Issue 7, Copyright (C) 2013 by the Institute of
|
|
Packit |
7cfc04 |
Electrical and Electronics Engineers, Inc and The Open Group.
|
|
Packit |
7cfc04 |
(This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
|
|
Packit |
7cfc04 |
event of any discrepancy between this version and the original IEEE and
|
|
Packit |
7cfc04 |
The Open Group Standard, the original IEEE and The Open Group Standard
|
|
Packit |
7cfc04 |
is the referee document. The original Standard can be obtained online at
|
|
Packit |
7cfc04 |
http://www.unix.org/online.html .
|
|
Packit |
7cfc04 |
|
|
Packit |
7cfc04 |
Any typographical or formatting errors that appear
|
|
Packit |
7cfc04 |
in this page are most likely
|
|
Packit |
7cfc04 |
to have been introduced during the conversion of the source files to
|
|
Packit |
7cfc04 |
man page format. To report such errors, see
|
|
Packit |
7cfc04 |
https://www.kernel.org/doc/man-pages/reporting_bugs.html .
|