PARDO(1)

NAME
pardo - run sh(1) commands in parallel

SYNOPSIS
pardo [-v variable_name] [-c command_string] [-m max_processes] arg ...

DESCRIPTION

Reads sh commands (from standard input if no -c option given) and executes them once for each arg, setting an environment variable to the current arg for each run. If -v is not given then "parvar" is used. Execution of commands for each arg occurs in parallel processes. Standard output and standard error output from parallel runs are serialized, so it looks the same as it would if the runs for each arg were executed sequentially in the order given.

RETURNS

Returns 0 status if all instances of the command string return 0. Otherwise, returns the nonzero status of the first command string instance to do likewise. ("first" being relative to the order of the arguments given to pardo.)

-h, --help
    Display some help and exit

-v s, --var=s
    The name of an environment variable which will be set to one of the args when the sh(1) commands are executed.

-c s, --commands=s
    A string to be executed by sh(1) once for each arg. If not given, pardo reads from standard input.

-m i, --maxprocs=i
    The maximum number of worker processes to allow to exist at a time. The default is 5. When the maximum number of processes are spawned, pardo waits until one completes before starting a new instance of the command string.

ENVIRONMENT

parvar
    This is the name of the environment variable that parvar uses by default to pass arguments to your command string. You can use the -v option to specify a different name.

EXAMPLES

   pardo -c 'makewhatis $parvar' /usr/man /usr/local/man

Builds indexes for each man directory in parallel. (You wouldn't want to do this if your man directories are all on the same partition.)

   pardo /usr/man /usr/local/man <<odrap
      makewhatis \$parvar
   odrap

Same as above, but uses standard input to simulate the appearance of a for loop. Potentially reasonable for using pardo in scripts.

REPORTING BUGS

Report bugs to <bdarrah@pacbell.net>.

SEE ALSO

sh(1)

AUTHOR

Byron Darrah <bdarrah@pacbell.net>