redirected-output examples at cover docs

This commit is contained in:
John Kerl 2016-08-11 14:12:40 -05:00
parent 8e51a219c8
commit 5acdea4590
9 changed files with 25 additions and 2 deletions

View file

@ -34,6 +34,9 @@ indices. Examples:
$mean = $sum / $count # no assignment if count unset
'
% mlr --from infile.dat put -f analyze.mlr
% mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*'
% mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
% mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}'
```
This is something the Unix toolkit always could have done, and arguably always

View file

@ -248,6 +248,10 @@ static void main_usage_examples(FILE* o, char* argv0, char* leader) {
fprintf(o, " }\n");
fprintf(o, " $mean = $sum / $count # no assignment if count unset'\n");
fprintf(o, "%s%s --from infile.dat put -f analyze.mlr\n", leader, argv0);
fprintf(o, "%s%s --from infile.dat put 'tee > \"./taps/data-\".$a.\"-\".$b, $*'\n", leader, argv0);
fprintf(o, "%s%s --from infile.dat put -q '@v=$*; dump | \"jq .[]\"'\n", leader, argv0);
fprintf(o, "%s%s --from infile.dat put '(NR %% 1000 == 0) { print > stderr, \"Checkpoint \".NR}'\n",
leader, argv0);
}
static void list_all_verbs_raw(FILE* o) {

View file

@ -31,8 +31,6 @@ COMMON:
* mlr -k | grep mlr | sed 's/Example: //' | sh 1>1 2>2
! flesh out ...'s in mlr -k's
* some >/>>/| at cover x 3
* lrec_reader factor take popts as well
~ lrec_reader/writer take sub-bagged cliopts pstructs
~ put/tee --oxxx flags overlays, w/ substruct data & federated substruct fcns

View file

@ -16,3 +16,6 @@
$mean = $sum / $count # no assignment if count unset
'
% mlr --from infile.dat put -f analyze.mlr
% mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*'
% mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
% mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}'

View file

@ -169,6 +169,9 @@ positional indices. For example:
$mean = $sum / $count # no assignment if count unset
'
% mlr --from infile.dat put -f analyze.mlr
% mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*'
% mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
% mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}'
</pre>
</div>
<p/>

View file

@ -185,6 +185,9 @@ EXAMPLES
}
$mean = $sum / $count # no assignment if count unset'
mlr --from infile.dat put -f analyze.mlr
mlr --from infile.dat put 'tee &gt; "./taps/data-".$a."-".$b, $*'
mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
mlr --from infile.dat put '(NR % 1000 == 0) { print &gt; stderr, "Checkpoint ".NR}'
DATA FORMATS
DKVP: delimited key-value pairs (Miller default format)

View file

@ -39,6 +39,9 @@ EXAMPLES
}
$mean = $sum / $count # no assignment if count unset'
mlr --from infile.dat put -f analyze.mlr
mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*'
mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}'
DATA FORMATS
DKVP: delimited key-value pairs (Miller default format)

View file

@ -64,6 +64,9 @@ mlr --from estimates.tbl put '
}
$mean = $sum / $count # no assignment if count unset'
mlr --from infile.dat put -f analyze.mlr
mlr --from infile.dat put 'tee > "./taps/data-".$a."-".$b, $*'
mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
mlr --from infile.dat put '(NR % 1000 == 0) { print > stderr, "Checkpoint ".NR}'
.fi
.if n \{\
.RE

View file

@ -336,6 +336,9 @@ Command-line-syntax examples:
}
$mean = $sum / $count # no assignment if count unset'
mlr --from infile.dat put -f analyze.mlr
mlr --from infile.dat put 'tee &gt; "./taps/data-".$a."-".$b, $*'
mlr --from infile.dat put -q '@v=$*; dump | "jq .[]"'
mlr --from infile.dat put '(NR % 1000 == 0) { print &gt; stderr, "Checkpoint ".NR}'
Data-format examples:
DKVP: delimited key-value pairs (Miller default format)