GNU Parallel, where have you been all my life?
alexplescan.com
GNU Parallel, where have you been all my life?
1–10 of 277 posts
Re: GNU Parallel, where have you been all my life?
#2Re: GNU Parallel, where have you been all my life?
#3Many thanks to Ole Tange for developing the wonderful tool and helping the users on Stack Overflow sites to this day.
Shameless plug, I am developing a tutorial on GNU Parallel to be presented at eScience conference in Cyprus this year: https://www.escience-conference.org/2023/tutorials/gnu_paral...
Re: GNU Parallel, where have you been all my life?
#4Edited to add: finally got signed in to work, you create the script via:
parallel --embed > scriptname.sh
It's about 14,000 lines of awesome and works on "ash, bash, dash, ksh, sh, and zsh"Re: GNU Parallel, where have you been all my life?
#5What about & and wait? Could it have been an adequate alternative?
But it can be done in pure BASH: https://gist.github.com/mped-oticon/b11dafa937e694ce4fa6fbf2...
GNU parallel supports expansion, which bash_parallel doesn't. However bash_parallel works with bash functions, which GNU parallel doesn't.
Re: GNU Parallel, where have you been all my life?
#6What about & and wait? Could it have been an adequate alternative?
Here are a bunch of examples: https://www.gnu.org/software/parallel/parallel_examples.html
A fun one I end up using ~monthly or so for various things (usually with more switches added as needed):
GNU Parallel as queue system/batch manager
# start queue
true >jobqueue; tail -n+0 -f jobqueue | parallel
# add job
echo my_command my_arg >> jobqueue
# to start queue for remote execution
true >jobqueue; tail -n+0 -f jobqueue | parallel -S ..Re: GNU Parallel, where have you been all my life?
#7Re: GNU Parallel, where have you been all my life?
#8Re: GNU Parallel, where have you been all my life?
#9What about & and wait? Could it have been an adequate alternative?
Re: GNU Parallel, where have you been all my life?
#10xargs is more useful because it's posix so you can always guarantee it to be there (whereas with GNU Parallel you probably have to reach for a package manager to install it first). The ergonomics are worse though, as usual.