Subject: Re: psh
To: Simon J. Gerraty <>
From: dustin sallings <>
List: current-users
Date: 10/19/1998 00:23:17
On Mon, 19 Oct 1998, Simon J. Gerraty wrote:

//      parallel - run command line for each arg from stdin
//      parallel [-n n] command [arg] ... < arglist
//      This tool executes command for each element of arglist.   If
//      command  contains  any spaces or I/O redirection, we pass it
//      to sh(1) to execute it (there should be no additional args),
//      otherwise we first attempt to exec(2) command directly.

	I wrote almost this exact program last night, but it didn't
*quite* do what I needed, so I went with putting it in sh.

// Anyway, hacking this into sh is probably not the best solution.

	It is for my needs.  It makes perfect sense for what I'm doing. I
only wrote to this list because I figured someone, somewhere may have
similar needs.  I want to execute an entire for block in parallel.  The
same could be done with your tool, of course, by writing a shell script,
and having one shell script use a parallel and call another shell script
(assuming the arglist wasn't too long, but I could very well have the same
problem in the for loop), but I could've as easily done that with the tool
I wrote.

	Originally, I wrote a program that would write out a Makefile that
a parallel make could use to do the work for me, but that involved three
scripts, the one I run, the one that writes the new one, and the new one
that gets run to actually do the work.  This is fairly ugly, and requires
a lot more maintenence than the original for loop.  psh requires exactly
as much maintence as the original for loop.  :)

SA,                            The world is watching America,
pub  1024/3CAE01D5 1994/11/03 Dustin Sallings <>
|    Key fingerprint =  87 02 57 08 02 D0 DA D6  C8 0F 3E 65 51 98 D8 BE 
L________________________________________ and America is watching TV. __