

            exit (1) --- terminate execution of command files        03/20/80


            _U_s_a_g_e

                 exit  [ <levels> ]


            _D_e_s_c_r_i_p_t_i_o_n

                 'Exit' causes execution of one or more currently active com-
                 mand  files  to  cease.   It is somewhat similar to the PL/I
                 "return" statement in that it simulates a normal termination
                 of at least one environment (scope).

                 When invoked, 'exit' positions the  <levels>  most  recently
                 activated command files to end-of-file and dumps the command
                 interpreter's  internal command buffer.  Thus, when the com-
                 mand interpreter next attempts to fetch a command,  it  sees
                 <levels>   successive   ends-of-file   and   cleans  up  the
                 associated environments.  If <levels> is omitted,  only  one
                 level is terminated.

                 'Exit'  is  most often used to terminate a command file when
                 some error condition defined by the user occurs  (for  exam-
                 ple,  an  attempt to use the command file by an unauthorized
                 user).


            _E_x_a_m_p_l_e_s

                 if 1
                    echo "Sorry, you are not allowed to use this program."
                    exit
                 fi


            _B_u_g_s

                 May behave irrationally if <levels> is too large.


            _S_e_e _A_l_s_o

                 error (1), if (1), sh (1), goto (1), _U_s_e_r_'_s  _G_u_i_d_e  _f_o_r  _t_h_e
                 _S_o_f_t_w_a_r_e _T_o_o_l_s _S_u_b_s_y_s_t_e_m _C_o_m_m_a_n_d _I_n_t_e_r_p_r_e_t_e_r















            exit (1)                      - 1 -                      exit (1)


