UNSET(1POSIX)
π UNSET(1POSIX) π
okay bestie, welcome to the UNSET(1POSIX) page from the POSIX Programmer's Manual β¨ yes that's the one, this is literally her moment
πΈ PROLOG πΈ
So here's the tea: this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the deets on Linux behavior, bestie), or the interface might not even be implemented on Linux at all. π no cap.
π NAME π
unset β unset values and attributes of variables and functions π
π SYNOPSIS π
unset [-fv] name...
β¨ DESCRIPTION β¨
Every single variable or function you name with name shall be unset. periodt.
If -v is specified, then name refers to a variable name, and the shell shall unset it and remove it from the environment. π«Ά but heads up: read-only variables cannot be unset. like, they said no. π
If -f is specified, name refers to a function, and the shell shall unset the function definition. bye bestie π
If neither -f nor -v is specified, name refers to a variable. and if a variable by that name doesn't exist? it is unspecified whether a function by that name, if any, shall be unset. so like... undefined vibes, we don't know. π
Unsetting a variable or function that was not previously set shall not be considered an error and does not cause the shell to abort. slay, no drama. β¨
The unset special built-in shall support the Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines. yes queen, follow the guidelines. π
Note that:
VARIABLE=
is not equivalent to an unset of VARIABLE β in that example, VARIABLE is set to "". so it's still there, just empty. not the same thing, don't get it twisted. π
Also, the variables that can be unset should not be misinterpreted to include the special parameters (see Section 2.5.2, Special Parameters). those are a different category entirely, iykyk. π¦
π OPTIONS π
See the DESCRIPTION. (yes really, that's the whole section. she said go read. π )
πΈ OPERANDS πΈ
See the DESCRIPTION. (again. it's all up there bestie π)
π§ STDIN π§
Not used. she doesn't read stdin, she's not that kind of girl. π
π INPUT FILES π
None. zero. nada. β¨
π ENVIRONMENT VARIABLES π
None. she doesn't check the environment, she just cleans it. π
β ASYNCHRONOUS EVENTS β
Default. π
π STDOUT π
Not used. no output, only vibes. π
π¦ STDERR π¦
The standard error shall be used only for diagnostic messages. so if she's talking, something went wrong. π
πΈ OUTPUT FILES πΈ
None. π«Ά
π EXTENDED DESCRIPTION π
None. nothing extra to say, she's a simple icon. π
β¨ EXIT STATUS β¨
0β All name operands were successfully unset. ate. π₯>0β At least one name could not be unset. rip. π
π CONSEQUENCES OF ERRORS π
Default.
The following sections are informative. (translation: the fun stuff is next, bestie β¨)
π APPLICATION USAGE π
None. π
π EXAMPLES π
Unset VISUAL variable:
unset -v VISUAL
Unset the functions foo and bar:
unset -f foo bar
iconic. simple. effective. π«Ά
π₯ RATIONALE π₯
So, consideration was given to omitting the -f option in favor of an unfunction utility, but the standard developers decided to retain historical practice. they said keep the tradition, bestie. π
The -v option was introduced because System V historically used one name space for both variables and functions. so when unset is used without options, System V historically unset either a function or a variable, and there was no confusion about which one was intended. (wild, right? π)
A portable POSIX application can use unset without an option to unset a variable, but not a function β for a function, the -f option must be used. no shortcuts, that's the rule. π
π¦ FUTURE DIRECTIONS π¦
None. the future is unbothered. β¨
π SEE ALSO π
- Section 2.14, Special Built-In Utilities
- The Base Definitions volume of POSIX.1β2017, Section 12.2, Utility Syntax Guidelines
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page bestie, you're officially educated π β¨
okay so this was brought to you by IEEE/The Open Group, 2017, and the manual is literally called UNSET(1POSIX) β she's a 2017 baby and she's still serving looks. π bye bestie, go unset something (responsibly) π«Άπ
π¦ where this page comes from
- debian bookworm: manpages-posix 2017a-2 Β· Other
- debian trixie: manpages-posix 2017a-2 Β· Other
- ubuntu jammy: manpages-posix 2017a-2 Β· Other
- ubuntu noble: manpages-posix 2017a-2 Β· Other
- ubuntu resolute: manpages-posix 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms