You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo'When using commands from arguments, numbered variables `{0}`, `{1}`, etc are automatically available based on the number of arguments. `{0}` will be replaced by the entire input line, and other groups match individual argument groups. This is useful for building more complex command lines. For example:
65
+
echo'When using commands from arguments, numbered variables `{0}`, `{1}`, etc are automatically available based on the number of arguments. `{0}` will be replaced by the entire input line, and other groups match individual argument groups. `{}` is the same as `{0}`. This is useful for building more complex command lines. For example:
66
66
'
67
67
68
68
echo'```
69
69
$ rust-parallel echo group0={0} group1={1} group2={2} group3={3} group2again={2} ::: A B ::: C D ::: E F G'
70
70
$RUST_PARALLELecho group0={0} group1={1} group2={2} group3={3} group2again={2} ::: A B ::: C D ::: E F G
71
71
echo'```'
72
72
73
+
echo'```
74
+
$ rust-parallel echo entireline={} group1={1} group2={2} group3={3} group2again={2} ::: A B ::: C D ::: E F G'
75
+
$RUST_PARALLELecho entireline={} group1={1} group2={2} group3={3} group2again={2} ::: A B ::: C D ::: E F G
76
+
echo'```'
77
+
73
78
echo'Internally these variables are implemented using an auto-generated [regular expression](#regular-expression). If a regular expression is manually specified this will override the auto-generated one.'
74
79
75
80
echo'## Commands from stdin
@@ -305,22 +310,22 @@ Regular expressions can be specified by the `-r` or `--regex` command line argum
305
310
306
311
### Named Capture Groups
307
312
308
-
In these examples using command line arguments `{url}` and `{filename}` are named capture groups. `{0}` is a numbered capture group.
313
+
In these examples using command line arguments `{url}` and `{filename}` are named capture groups. `{}` is a variable meaning the entire input line.
In the next example input file arguments `{0}` `{1}` `{2}` `{3}` are numbered capture groups, and the input is a csv file:'
328
+
In the next example input file arguments `{1}` `{2}` `{3}` are numbered capture groups, `{}` is a variable meaning the entire input line. The input is a csv file:'
324
329
325
330
echo'```'
326
331
echo'$ cat >./test <<EOL
@@ -335,8 +340,8 @@ foo3,bar3,baz3
335
340
EOL
336
341
337
342
echo
338
-
echo -e '$ cat test | rust-parallel -r \x27(.*),(.*),(.*)\x27 echo got arg1={1} arg2={2} arg3={3} full input={0}'
339
-
cat test|$RUST_PARALLEL -r '(.*),(.*),(.*)'echo got arg1={1} arg2={2} arg3={3} full input={0}
343
+
echo -e '$ cat test | rust-parallel -r \x27(.*),(.*),(.*)\x27 echo got arg1={1} arg2={2} arg3={3} full input={}'
344
+
cat test|$RUST_PARALLEL -r '(.*),(.*),(.*)'echo got arg1={1} arg2={2} arg3={3} full input={}
0 commit comments