MPE/iX Shell and Utilities Reference Manual, Vol 2

xargs(1) MPE/iX Shell and Utilities xargs(1)
If no command template appears on the command line, xargs uses echo by default. When
xargs executes a command, it uses your search rules to find the command; this means that
you can run shell scripts as well as normal programs.
Note that the command you want to execute should be in your search
PATH
.
xargs terminates prematurely if it cannot execute a constructed command or if an executed
command returns a non-zero status value. If an executed command is a shell program, it
should explicitly contain an exit command to avoid returning a non-zero status value by ac-
cident; see sh(1) for details.
xargs also accepts the following options: You can use the following options with any of the
three main options.
–eeofstr
defines eofstr to represent end-of-file on the standard input. For example,
-e:::
tells xargs that ::: represents the end of the standard input, even if it is not at the
end of the file. If there is no –e option, a single underscore (_) marks the end of the
input. If you specify –e without a following string, it indicates that there is no end-
of-file marker string; this means that _ is taken literally instead of as an end-of-file
marker. xargs stops reading input when it reaches the specified end-of-file marker
or the true end of the file.
–p prompts you before each command. This turns on the –t option so that you see each
constructed command before it is executed. Then, xargs displays ?..., asking if
you really want to executed this command. If you type a string beginning with y,
xargs goes ahead and executes the command as displayed; otherwise, the command
is not executed, and xargs goes on to construct a new command.
–s size sets the maximum allowable size of an argument list to size characters (where size is
an integer). The value of size must be less than or equal to the system variable
LINE_MAX. The length of the argument list is the length of the entire constructed
command; this includes the length of the command name, the length of each argu-
ment, plus one blank for separating each item on the line.
–t writes each constructed command to the standard error just before executing the
command.
–x terminates xargs if it creates a command that is longer than the size given by the
–s option (or {LINE_MAX}did not specify –s). This option comes into effect auto-
matically if you specify –i or –l.
Commands and Utilities 1-707