UNSET(1)                   POSIX Programmer's Manual                  UNSET(1)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.


NNAAMMEE
       unset -- unset values and attributes of variables and functions

SSYYNNOOPPSSIISS
       unset [[-fv]] _n_a_m_e...

DDEESSCCRRIIPPTTIIOONN
       Each variable or function specified by _n_a_m_e shall be unset.

       If --vv is specified, _n_a_m_e refers to a variable name and the shell shall
       unset it and remove it from the environment. Read-only variables cannot
       be unset.

       If --ff is specified, _n_a_m_e refers to a function and the shell shall unset
       the function definition.

       If neither --ff nor --vv is specified, _n_a_m_e refers to a variable; if a
       variable by that name does not exist, it is unspecified whether a
       function by that name, if any, shall be unset.

       Unsetting a variable or function that was not previously set shall not
       be considered an error and does not cause the shell to abort.

       The _u_n_s_e_t special built-in shall support the Base Definitions volume of
       POSIX.1-2008, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s.

       Note that:

           VVAARRIIAABBLLEE==

       is not equivalent to an _u_n_s_e_t of VVAARRIIAABBLLEE; in the example, VVAARRIIAABBLLEE is
       set to """".  Also, the variables that can be _u_n_s_e_t should not be
       misinterpreted to include the special parameters (see _S_e_c_t_i_o_n _2_._5_._2,
       _S_p_e_c_i_a_l _P_a_r_a_m_e_t_e_r_s).

OOPPTTIIOONNSS
       See the DESCRIPTION.

OOPPEERRAANNDDSS
       See the DESCRIPTION.

SSTTDDIINN
       Not used.

IINNPPUUTT FFIILLEESS
       None.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       None.

AASSYYNNCCHHRROONNOOUUSS EEVVEENNTTSS
       Default.

SSTTDDOOUUTT
       Not used.

SSTTDDEERRRR
       The standard error shall be used only for diagnostic messages.

OOUUTTPPUUTT FFIILLEESS
       None.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
       None.

EEXXIITT SSTTAATTUUSS
        0    All _n_a_m_e operands were successfully unset.

       >0    At least one _n_a_m_e could not be unset.

CCOONNSSEEQQUUEENNCCEESS OOFF EERRRROORRSS
       Default.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       None.

EEXXAAMMPPLLEESS
       Unset _V_I_S_U_A_L variable:

           uunnsseett --vv VVIISSUUAALL

       Unset the functions ffoooo and bbaarr:

           uunnsseett --ff ffoooo bbaarr

RRAATTIIOONNAALLEE
       Consideration was given to omitting the --ff option in favor of an
       _u_n_f_u_n_c_t_i_o_n utility, but the standard developers decided to retain
       historical practice.

       The --vv option was introduced because System V historically used one
       name space for both variables and functions. When _u_n_s_e_t is used without
       options, System V historically unset either a function or a variable,
       and there was no confusion about which one was intended.  A portable
       POSIX application can use _u_n_s_e_t without an option to unset a variable,
       but not a function; the --ff option must be used.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _S_e_c_t_i_o_n _2_._1_4, _S_p_e_c_i_a_l _B_u_i_l_t_-_I_n _U_t_i_l_i_t_i_e_s

       The Base Definitions volume of POSIX.1-2008, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y
       _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
       -- Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, Copyright (C) 2013 by the Institute of
       Electrical and Electronics Engineers, Inc and The Open Group.  (This is
       POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) 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.unix.org/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 .



IEEE/The Open Group                  2013                             UNSET(1)
