thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

Parallel

β€’ 209 words β€’ 1 min β€’ updated

⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.

Apparently there are two Unix-y ways to run commands in parallel:

A simple example with wc -l:

GNU receives input from stdin:

shell
find . -type f | parallel wc -l

Moreutils receives input from command-line arguments:

shell
parallel wc -l -- $(find . -type f)

Style aside, the annoyance is that they are not compatible in Debian, Ubuntu and macOS (homebrew), due to both having the parallel executable:

Debian thread wherein no consensus is achieved: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597050

I will stick to moreutils due to its simplicity and richer suite. Nonetheless, it would be better if we didn’t have binary clashes like this. It is really annoying and developer-unfriendly.

Of course, my favorite Linux distributions do not have this issue:

shell
% apk info -L moreutils | grep parallel
usr/bin/parallel-moreutils

…Alpine just installs parallel from moreutils with another name.

Arch Linux does the same:

mv "$pkgdir"/usr/bin/parallel "$pkgdir"/usr/bin/parallel-moreutils

Moreover, GNU Parallel has an annoying citation notice, which the Arch Linux package helpfully removes1.


  1. Some context. Not everyone works in academia. Also it’s quite weird that the program is called “GNU parallel”, is published under the GPL, and yet does not seemingly follow the GPL guidelines. This is the official FAQ of the program. ↩︎