HOME

TheInfoList



OR:

pexec is a command-line utility for Linux and other Unix-like operating systems which allows the user to execute shell
commands Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
in parallel. The specified code can be executed either locally or on remote hosts, in which case ssh is used to build a secure tunnel between them. Similar to shell loops, a variable is changed as the loop starting the tasks iterates, so that many values can get passed to the specified command or script. pexec is a free software utility, and part of the GNU Project. It is available under the terms of GPLv3, and is part of the current
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of D ...
stable release.packages.debian.org/stable/pexec
/ref>


Usage

The most common usage is to replace the shell loop, for example: for x in alpha bravo charlie delta ; do do_something $x done to the form of: pexec -r alpha bravo charlie delta -e x -o - -c \ 'do_something $x' where the set with the 4 elements of "alpha" "bravo" "charlie" and "delta" define the possible values for the (environmental) variable $x. The program pexec features also * automatic redirection of standard input, output and error from/to regular files; * taking the input set from a file instead of command line argument; * the capability for re-formatting the output and error streams; * support for mutual exclusions and atomic command executions inside the shell loop (in order to, e.g. avoid unexpectedly high I/O
load Load or LOAD may refer to: Aeronautics and transportation *Load factor (aeronautics), the ratio of the lift of an aircraft to its weight *Passenger load factor, the ratio of revenue passenger miles to available seat miles of a particular transpo ...
); * using alternative remote shells instead of ssh. * using supervisor daemons to balance between the resources of concurrent pexec instances. Such optional features can be requested using command-line arguments. By default, pexec tries to detect the number of
CPU A central processing unit (CPU), also called a central processor, main processor or just processor, is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and ...
s and uses all of them.


See also

* GNU parallel * xargs


References


External links


Manual page of pexec

Project page
{{GNU GNU Project software Linux process- and task-management-related software