pexec

pexec is a command-line driven utility for Linux or other Unix-like operating systems which allows the user to execute "for ~ do ~ done" like shell loops in parallel. The specified command or (a piece of) script can be executed on both local and remote host computers, in the case of remote execution, ssh is used to build a secure tunnel between the hosts. Like in shell loops, a pre-defined shell (environmental) variable is varied during the loop which is passed transparently to the command or script. pexec is a free software utility, and part of the GNU Project.[1] It is available[2] under the terms of GPLv3 as well as it is part of the current Debian testing release.[3]

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

Such optional features can be requested using command-line arguments. By default, pexec tries to detect the number of CPUs and uses all of them.

See also

References

External links

This article is issued from Wikipedia - version of the 6/14/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.