

            shell (2) --- run the Subsystem command interpreter      09/11/84


          | _C_a_l_l_i_n_g _I_n_f_o_r_m_a_t_i_o_n

          |      integer function shell (fd)
          |      file_des fd

          |      Library:  vshlib (shell routine library)


          | _F_u_n_c_t_i_o_n

          |      'Shell'  takes an open file descriptor as its only argument.
          |      The shell reads command lines from this file descriptor, and
          |      attempts to execute the commands.

          |      This is the main routine for the user level shell  as  well.
          |      For  details  on  how to use the shell, see _T_h_e _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.

          |      Having the shell as a subroutine opens up many possibilities
          |      not previously available to the programmer.   However,  care
          |      must  be  exercised  when  using  the shell.  In particular,
          |      since EPF's are not currently supported, it  is  quite  pos-
          |      sible   for   two   user   programs  called  from  different
          |      invocations of the shell to destroy each other's code and/or
          |      data.  For example, if you run 'se' on one  file,  and  then
          |      from  'se' you run the shell, and from the new shell you run
          |      'se' on a second file, the second 'se'  will  overwrite  the
          |      data  of  the  first 'se' (effectively destroying your first
          |      editing  session).   This  is  because  the  data  for  both
          |      instances of 'se' are loaded into the same area of (virtual)
          |      memory.   There is currently no safe way to get around this,
          |      other than to be careful about what programs  you  run  from
          |      subsidiary  invocations  of  the  shell.  (The screen editor
          |      should  be  relatively  safe  from  most  programs  (besides
          |      another 'se'), since its data is not loaded into the default
          |      segment  (segment  4000),  and  the code is in a shared seg-
          |      ment.)

          |      When EPF's are supported, it is recommended that  everything
          |      then  be  reloaded  in  EPF  format.  This will allow you to
          |      invoke programs from subsidiary  shells  without  having  to
          |      worry about what segment a program loads in.  Until then, it
          |      is  recommended  that  you  do  not  use this subroutine for
          |      programs that will be loaded in segment 4000, since as  soon
          |      as  you  run  another  external  program which also loads in
          |      4000, the first program will be destroyed.  (When the second
          |      program exits, you will end up back in the lowest  level  of
          |      the shell.)

          |      'Shell'  returns  OK  if  everything went well, otherwise it
          |      returns ERR.


          | _I_m_p_l_e_m_e_n_t_a_t_i_o_n

          |      Too complicated to describe here.


            shell (2)                     - 1 -                     shell (2)




            shell (2) --- run the Subsystem command interpreter      09/11/84


          | _A_r_g_u_m_e_n_t_s _M_o_d_i_f_i_e_d

          |      None


          | _S_e_e _A_l_s_o

          |      _T_h_e _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, sh (1), subsys (2)

















































            shell (2)                     - 2 -                     shell (2)


