Paulo Marcel Coelho Aragão

Authored Comments

Very useful article ! I'd like to offer a suggestion: the first example of usage of parallel:

find . -name "*jpeg" | parallel -I% --max-args 1 convert % %.png

may mislead into thinking that it may be always necessary to define the placeholder with -I. parallel has a rich set of placeholders, for all purposes, and they should be used. Moreover, in the example, the PNG filename will be JPEG filename with .png appended. A more natural way of coding that example would be:

find . -name "*jpeg" | parallel --verbose --max-args 1 convert {} {.}.png

The --verbose is quite essential, I think, so that one sees what command lines parallel is executing.

A correction: this is wrong:

"Luckily, that technicality is parsed by Parallel itself. If you set --jobs to 2, you get two variables, {1} and {2}, representing the first and second parts of the argument:

$ ls -1 | parallel --max-args=2 --jobs 2 cat {1} {2} ">" {1}_{2}.person"

The variables {1} and {2} are available because of --max-args=2 and not because of --jobs=2. There's no need for --jobs=2 in this example.