[PLUG] question on obtaining the PID numbers of a batch command and finding out when a batch script has successfully terminated

Ben Koenig techkoenig at protonmail.com
Tue Oct 8 01:40:18 UTC 2024


On Monday, October 7th, 2024 at 6:28 PM, Russell Senior <russell at personaltelco.net> wrote:

> On Mon, Oct 7, 2024 at 3:54 AM Robert Citek robert.citek at gmail.com wrote:
> 
> > Sounds like you are wanting to manage parallel jobs. Have you looked into
> > using the parallel command?
> > 
> > https://www.gnu.org/software/parallel/
> 
> 
> That's cool! Thank you for mentioning it.
> 
> --
> Russell Senior
> russell at personaltelco.net

I just realized my little scriptlet didn't run the gp command in parallel, but it looks like adding parallel is pretty easy.

function foo () {
	gp -q < $1 > $1.results
	echo "$1 finished: $?" >> process_log.txt
}

export -f foo
parallel foo ::: xaa xab xac xad xae xaf ::: a

my foo() function runs in parallel, taking x?? as a parameter. It has a strange syntax, but works like magic. 


More information about the PLUG mailing list