xe
Simple xargs and apply replacement
TLDR
SYNOPSIS
xe [-0FLnqvR] [-I replace-arg] [-N maxargs] [-j maxjobs] [-f argfile] [-s shellscript] [-a] [command [_args...]]
DESCRIPTION
xe is a tool for constructing command lines from file listings or arguments, combining the best features of xargs(1) and apply(1). By default it runs the given command once per input line, substituting {} with the argument, making common use cases simpler than xargs.Unlike xargs, xe has sane defaults: it is equivalent to `xargs -d'\n' -I{} -n1 -r`. Arguments can be read from stdin (default), from a file with -f, or directly from the command line after -a.xe supports parallel execution with -j, make-style percent rule matching with -p, and can invoke a shell script per argument with -s.
PARAMETERS
-0
Input arguments are separated by NUL bytes instead of newlines. Useful with `find -print0`.-a
Take arguments from the command line (after the command, separated by --) instead of stdin.-A argsep
Use a custom argument separator instead of -- (implies -a).-f argfile
Read arguments from argfile instead of stdin.-F
Fatal: stop and exit when a command execution fails.-I replace-arg
Set the replacement string (default: {}).-j maxjobs
Run up to maxjobs processes concurrently.-L
Line-buffered output so lines from concurrent jobs do not interleave.-N maxargs
Pass up to maxargs arguments to each command invocation (default: 1).-n
Dry-run: print the commands that would be executed without running them.-p
Make-style percent rule matching for pattern-dispatched commands.-q
Quiet: redirect stdout/stderr of commands to /dev/null.-R
Return exit status 122 when no arguments are supplied (instead of 0).-s shellscript
Execute shellscript via the shell; arguments are available as $1, $2, etc.-v
Verbose: print commands to stderr before running them.
CAVEATS
xe is distinct from the XenServer xe CLI and from xargs despite similar goals. If xargs compatibility is required, flags and behavior may differ (for example xe uses {} as placeholder by default and always runs one command per argument unless -N is given).
HISTORY
xe was written by Leah Neukirchen as a modernized replacement for xargs(1) and apply(1) with saner defaults and a cleaner interface. It is distributed as a small, portable C program.
