Hello,
I have only recently discovered parallel and wish I had found it years ago. Thanks for such a great tool, Ole! Mange tak!
I have a couple of questions from my reading of the tutorial ('man parallel_tutorial').
$ parallel --version
GNU parallel 20150722
Q1.
Around line 420 there is this in the discussion of Perl _expression_ replacement strings:
If the short hand starts with '{' it can be used as a positional replacement string, too:
parallel --rpl '{..} s:\.[^.]+$::;s:\.[^.]+$::;' echo '{..}' ::: foo.tar.gz
Positional replacement strings like {2} aren't introduced until the next section. What is the advantage in using this replacement string as '{..}' rather than '..' ?
(BTW, "short hand" as two words looks strange to me. I would write "shorthand". As two words it implies an actual human hand that is shorter than normal, at least to me!)
Q2.
Around line 1595 we have an example of records with multiple lines:
If a record is 75 lines -L can be used:
cat num1000000 | parallel --pipe -L75 wc
Output (the order may be different):
165600 165600 1048095
149850 149850 1048950
149775 149775 1048425
149775 149775 1048425
149850 149850 1048950
149775 149775 1048425
85350 85350 597450
25 25 176
We see that 6 processes got the default block of 1 MB or so, a seventh got most of the remainder, and an eight got a tiny scrap. Why was there an eighth process? In other words, why didn't the seventh process get all of the rest? Is the reason simply that the seventh process stopped receiving input with the end of the last full record, and the eighth got the partial record that was left over?
- Rory Molinari