parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recommendations for getting Parallel-like ::: behavior using Bash


From: Rhys Ulerich
Subject: Recommendations for getting Parallel-like ::: behavior using Bash
Date: Fri, 14 Mar 2014 20:46:06 -0500

I've got some shells scripts where I've been calling using "protected"
globs, e.g.
    myscript sample\*.thing
followed by explicitly expanding the glob inside the script.  This is
krufty and ugly.

I like how GNU Parallel does its ::: magic as that would let me say
    myscript ::: sample*.thing
avoiding the kruft.

Has anyone implemented something similar in pure bash?  If so, care to share?

My guess is to use getopt or similar to eat flags followed by while
loop accumulating everything until the ::: into an array.  That array
is then used to process everything after the ::: in another shift-ish
loop.

Note, I'm not asking about using parallel in shebang mode.  Just
mimicking its style of processing arguments because I very much like
the design.

- Rhys



reply via email to

[Prev in Thread] Current Thread [Next in Thread]