


      XXXXAAAARRRRGGGGSSSS((((1111))))                                                 XXXXAAAARRRRGGGGSSSS((((1111))))



      NNNNAAAAMMMMEEEE
           xargs - construct argument list(s) and execute command

      SSSSYYYYNNNNTTTTAAAAXXXX
           xxxxaaaarrrrggggssss [flags] [ command [initial-arguments] ]

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           _X_a_r_g_s combines the fixed _i_n_i_t_i_a_l-_a_r_g_u_m_e_n_t_s with arguments
           read from standard input to execute the specified _c_o_m_m_a_n_d
           one or more times.  The number of arguments read for each
           _c_o_m_m_a_n_d invocation and the manner in which they are combined
           are determined by the flags specified.

           _C_o_m_m_a_n_d, which may be a shell file, is searched for, using
           one's $$$$PPPPAAAATTTTHHHH.  If _c_o_m_m_a_n_d is omitted, ////bbbbiiiinnnn////eeeecccchhhhoooo is used.

           Arguments read in from standard input are defined to be
           contiguous strings of characters delimited by one or more
           blanks, tabs, or new-lines; empty lines are always
           discarded.  Blanks and tabs may be embedded as part of an
           argument if escaped or quoted:  Characters enclosed in
           quotes (single or double) are taken literally, and the
           delimiting quotes are removed.  Outside of quoted strings a
           backslash (\\\\) will escape the next character.

           Each argument list is constructed starting with the
           _i_n_i_t_i_a_l-_a_r_g_u_m_e_n_t_s, followed by some number of arguments read
           from standard input (Exception: see ----iiii flag).  Flags ----iiii, ----llll,
           and ----nnnn determine how arguments are selected for each command
           invocation.  When none of these flags are coded, the
           _i_n_i_t_i_a_l-_a_r_g_u_m_e_n_t_s are followed by arguments read
           continuously from standard input until an internal buffer is
           full, and then _c_o_m_m_a_n_d is executed with the accumulated
           args.  This process is repeated until there are no more
           args.  When there are flag conflicts (e.g., ----llll vs.  ----nnnn), the
           last flag has precedence.  _F_l_a_g values are:

           ----llll_n_u_m_b_e_r            _C_o_m_m_a_n_d is executed for each non-empty
                               _n_u_m_b_e_r lines of arguments from standard
                               input.  The last invocation of _c_o_m_m_a_n_d
                               will be with fewer lines of arguments if
                               fewer than _n_u_m_b_e_r remain.  A line is
                               considered to end with the first new-
                               line _u_n_l_e_s_s the last character of the
                               line is a blank or a tab; a trailing
                               blank/tab signals continuation through
                               the next non-empty line.  If _n_u_m_b_e_r is
                               omitted 1 is assumed.  Option ----xxxx is
                               forced.

           ----iiii_r_e_p_l_s_t_r           Insert mode:  _c_o_m_m_a_n_d is executed for
                               each line from standard input, taking



      Page 1                                                   (9010-E)






      XXXXAAAARRRRGGGGSSSS((((1111))))                                                 XXXXAAAARRRRGGGGSSSS((((1111))))



                               the entire line as a single arg,
                               inserting it in _i_n_i_t_i_a_l-_a_r_g_u_m_e_n_t_s for
                               each occurrence of _r_e_p_l_s_t_r.  A maximum
                               of 5 arguments in _i_n_i_t_i_a_l-_a_r_g_u_m_e_n_t_s may
                               each contain one or more instances of
                               _r_e_p_l_s_t_r.  Blanks and tabs at the
                               beginning of each line are thrown away.
                               Constructed arguments may not grow
                               larger than 255 characters, and option
                               ----xxxx is also forced.  {{{{}}}} is assumed for
                               _r_e_p_l_s_t_r if not specified.

           ----nnnn_n_u_m_b_e_r            Execute _c_o_m_m_a_n_d using as many standard
                               input arguments as possible, up to
                               _n_u_m_b_e_r arguments maximum.  Fewer
                               arguments will be used if their total
                               size is greater than _s_i_z_e characters,
                               and for the last invocation if there are
                               fewer than _n_u_m_b_e_r arguments remaining.
                               If option ----xxxx is also coded, each _n_u_m_b_e_r
                               arguments must fit in the _s_i_z_e
                               limitation, else _x_a_r_g_s terminates
                               execution.

           ----tttt                  Trace mode: The _c_o_m_m_a_n_d and each
                               constructed argument list are echoed to
                               file descriptor 2 just prior to their
                               execution.

           ----pppp                  Prompt mode: The user is asked whether
                               to execute _c_o_m_m_a_n_d each invocation.
                               Trace mode (----tttt) is turned on to print
                               the command instance to be executed,
                               followed by a ????............ prompt.  A reply of yyyy
                               (optionally followed by anything) will
                               execute the command; anything else,
                               including just a carriage return, skips
                               that particular invocation of _c_o_m_m_a_n_d.

           ----xxxx                  Causes _x_a_r_g_s to terminate if any
                               argument list would be greater than _s_i_z_e
                               characters; ----xxxx is forced by the options
                               ----iiii and ----llll.  When neither of the options
                               ----iiii, ----llll, or ----nnnn are coded, the total
                               length of all arguments must be within
                               the _s_i_z_e limit.

           ----ssss_s_i_z_e              The maximum total size of each argument
                               list is set to _s_i_z_e characters; _s_i_z_e
                               must be a positive integer less than or
                               equal to 470. If ----ssss is not coded, 470 is
                               taken as the default.  Note that the



      Page 2                                                   (9010-E)






      XXXXAAAARRRRGGGGSSSS((((1111))))                                                 XXXXAAAARRRRGGGGSSSS((((1111))))



                               character count for _s_i_z_e includes one
                               extra character for each argument and
                               the count of characters in the command
                               name.

           ----eeee_e_o_f_s_t_r            _E_o_f_s_t_r is taken as the logical end-of-
                               file string.  Underbar (_) is assumed
                               for the logical EEEEOOOOFFFF string if ----eeee is not
                               coded.  ----eeee with no _e_o_f_s_t_r coded turns
                               off the logical EEEEOOOOFFFF string capability
                               (underbar is taken literally).  _X_a_r_g_s
                               reads standard input until either end-
                               of-file or the logical EEEEOOOOFFFF string is
                               encountered.

           _X_a_r_g_s will terminate if either it receives a return code of
           ----1111 from, or if it cannot execute, _c_o_m_m_a_n_d.  When _c_o_m_m_a_n_d is
           a shell program, it should explicitly _e_x_i_t (see _s_h(1)) with
           an appropriate value to avoid accidentally returning with
           ----1111.

      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
           The following will move all files from directory $1 to
           directory $2, and echo each move command just before doing
           it:

                     ls $1 | xargs -i -t mv $1/{} $2/{}

           The following will combine the output of the parenthesized
           commands onto one line, which is then echoed to the end of
           file _l_o_g:

                     (logname; date; echo $0 $*) | xargs >>log

           The user is asked which files in the current directory are
           to be archived and archives them into _a_r_c_h (1.) one at a
           time, or (2.) many at a time.

                     1.  ls | xargs -p -l ar r arch
                     2.  ls | xargs -p -l | xargs ar r arch

           The following will execute _d_i_f_f(1) with successive pairs of
           arguments originally typed as shell arguments:

                     echo $* | xargs -n2 diff

      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS





      Page 3                                                   (9010-E)






