author | František Kučera <franta-hg@frantovo.cz> |
Thu, 07 Feb 2019 14:30:42 +0100 | |
branch | v_0 |
changeset 247 | 087b8621fb3e |
parent 244 | d4f401b5f90c |
child 325 | 4560c5623d7d |
permissions | -rw-r--r-- |
23
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
1 |
<stránka |
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
2 |
xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" |
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
3 |
xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"> |
0d2729ed16ed
zkouška interního odkazu
František Kučera <franta-hg@frantovo.cz>
parents:
18
diff
changeset
|
4 |
|
244
d4f401b5f90c
examples: move each example to a separate page + add generated list of examples
František Kučera <franta-hg@frantovo.cz>
parents:
241
diff
changeset
|
5 |
<nadpis>Filtering /etc/fstab using relpipe-tr-grep</nadpis> |
d4f401b5f90c
examples: move each example to a separate page + add generated list of examples
František Kučera <franta-hg@frantovo.cz>
parents:
241
diff
changeset
|
6 |
<perex>list only records with desired filesystem types</perex> |
d4f401b5f90c
examples: move each example to a separate page + add generated list of examples
František Kučera <franta-hg@frantovo.cz>
parents:
241
diff
changeset
|
7 |
<m:pořadí-příkladu>00900</m:pořadí-příkladu> |
4
1bb39595a51c
genrování hlavní nabídky #1
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
8 |
|
2
ab9099ff88fa
vkládání zápatí, jmenné prostory, saxon
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
9 |
<text xmlns="http://www.w3.org/1999/xhtml"> |
176
46042297e0d6
relpipe-tr-validator: specification and examples
František Kučera <franta-hg@frantovo.cz>
parents:
140
diff
changeset
|
10 |
|
208
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
11 |
<p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
12 |
If we are interested only in certain records in some relation, we can filter it using <code>relpipe-tr-grep</code>. |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
13 |
If we want to list e.g. only Btrfs and XFS file systems from our <code>fstab</code> (see above), we will run: |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
14 |
</p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
15 |
|
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
16 |
|
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
17 |
<m:pre jazyk="bash"><![CDATA[relpipe-in-fstab | relpipe-tr-grep 'fstab' 'type' 'btrfs|xfs' | relpipe-out-tabular]]></m:pre> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
18 |
|
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
19 |
<p>and we will get following filtered result:</p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
20 |
<pre><![CDATA[fstab: |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
21 |
╭─────────────────┬──────────────────────────────────────┬──────────────────────┬───────────────┬──────────────────┬────────────────┬────────────────╮ |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
22 |
│ scheme (string) │ device (string) │ mount_point (string) │ type (string) │ options (string) │ dump (integer) │ pass (integer) │ |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
23 |
├─────────────────┼──────────────────────────────────────┼──────────────────────┼───────────────┼──────────────────┼────────────────┼────────────────┤ |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
24 |
│ UUID │ a2b5f230-a795-4f6f-a39b-9b57686c86d5 │ /home │ btrfs │ relatime │ 0 │ 2 │ |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
25 |
│ │ /dev/mapper/sdf_crypt │ /mnt/private │ xfs │ relatime │ 0 │ 2 │ |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
26 |
╰─────────────────┴──────────────────────────────────────┴──────────────────────┴───────────────┴──────────────────┴────────────────┴────────────────╯ |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
27 |
Record count: 2]]></pre> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
28 |
|
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
29 |
<p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
30 |
Command arguments are similar to <code>relpipe-tr-sed</code>. |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
31 |
Everything is a regular expression. |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
32 |
Only relations matching the regex will be filtered, others will flow through the pipeline unmodified. |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
33 |
If the attribute regex matches more attribute names, filtering will be done with logical OR |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
34 |
i.e. the record is included if at least one of that attributes matches the search regex. |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
35 |
</p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
36 |
|
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
37 |
<p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
38 |
If we need exact match of the whole attribute, we have to use something like <code>'^btrfs|xfs$'</code>, |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
39 |
otherwise mere substring-match is enough to include the record. |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
40 |
</p> |
91a210d3b66a
examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents:
207
diff
changeset
|
41 |
|
87
25dec6931f18
Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents:
23
diff
changeset
|
42 |
</text> |
4
1bb39595a51c
genrování hlavní nabídky #1
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
43 |
|
1 | 44 |
</stránka> |