shell                  package:base                  R Documentation

_I_n_v_o_k_e _a _S_y_s_t_e_m _C_o_m_m_a_n_d, _u_s_i_n_g _a _S_h_e_l_l

_D_e_s_c_r_i_p_t_i_o_n:

     `shell' runs the command specified by `cmd', usually under a
     shell.

_U_s_a_g_e:

     shell(cmd, shell, flag="/c", intern=FALSE, wait=TRUE,
           translate=FALSE, mustWork=FALSE, ...)

_A_r_g_u_m_e_n_t_s:

     cmd: the system command to be invoked, as a string.

   shell: a string giving the name of the shell to be used, or `NULL'
          (no shell). If missing, a suitable shell is chosen: see
          `details'

    flag: the switch to run a command under the shell. If the shell is
          `bash' or `tcsh' the default is changed to `"-c"'.

  intern: a logical, indicates whether to make the output of the
          command an R object.

    wait: should the R interpreter wait for the command to finish? The
          default is to wait, and the interpreter will always wait if
          `intern = TRUE'.

translate: If `TRUE', `"/"' in `cmd' is translated to `"\"'.

mustWork: a logical; if `TRUE' failure to run the command will give an
          R error.

     ...: additional arguments to `system'.

_D_e_t_a_i_l_s:

     If no `shell' is specified, the environment variables `R_SHELL',
     `SHELL' and `COMSPEC' are tried in turn: `COMSPEC' should always
     succeed. Using `shell=NULL' invokes the command `cmd' directly, in
     which case an extension of `.exe' is assumed. It is possible to
     use batch files directly if their extension is given: Windows
     (rather than R) then chooses a shell.

     See `system' for fuller details: `shell' is a more user-friendly
     wrapper for `system'.

_V_a_l_u_e:

     If `intern=TRUE', a character vector giving the output of the
     command, one line per character string, or an error message if the
     command could not be run.

     If `intern=FALSE', the return value is a error code, given the
     invisible attribute (so needs to be printed explicitly). If the
     command could not be run for any reason, the value is `-1' and an
     R warning is generated. Otherwise if `wait=FALSE' the value is the
     error code returned by the command, and if `wait=TRUE' it is the
     zero (the conventional success value),

     If `intern=FALSE' and `wait=TRUE' (the defaults) the text output
     from a command that is a console application will appear in the R
     console (`Rgui') or the window running R (`Rterm').

_A_u_t_h_o_r(_s):

     B. D. Ripley

_S_e_e _A_l_s_o:

     `system'

