relpipe-data/examples-grep-fstab.xml
author František Kučera <franta-hg@frantovo.cz>
Mon, 21 Feb 2022 00:43:11 +0100
branchv_0
changeset 329 5bc2bb8b7946
parent 325 4560c5623d7d
permissions -rw-r--r--
Release v0.18
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
		
325
4560c5623d7d relpipe-tr-grep has new syntax since v0.18: --relation, --attribute, --value
František Kučera <franta-hg@frantovo.cz>
parents: 244
diff changeset
    17
		<m:pre jazyk="bash"><![CDATA[relpipe-in-fstab \
4560c5623d7d relpipe-tr-grep has new syntax since v0.18: --relation, --attribute, --value
František Kučera <franta-hg@frantovo.cz>
parents: 244
diff changeset
    18
	| relpipe-tr-grep --relation 'fstab' --attribute 'type' --value 'btrfs|xfs' \
4560c5623d7d relpipe-tr-grep has new syntax since v0.18: --relation, --attribute, --value
František Kučera <franta-hg@frantovo.cz>
parents: 244
diff changeset
    19
	| relpipe-out-tabular]]></m:pre>
208
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    20
				
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    21
		<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
    22
		<pre><![CDATA[fstab:
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
 │ 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
    25
 ├─────────────────┼──────────────────────────────────────┼──────────────────────┼───────────────┼──────────────────┼────────────────┼────────────────┤
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    26
 │ 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
    27
 │                 │ /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
    28
 ╰─────────────────┴──────────────────────────────────────┴──────────────────────┴───────────────┴──────────────────┴────────────────┴────────────────╯
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    29
Record count: 2]]></pre>
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    30
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    31
		<p>
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    32
			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
    33
			Everything is a regular expression.
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    34
			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
    35
			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
    36
			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
    37
		</p>
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    38
		
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    39
		<p>
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    40
			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
    41
			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
    42
		</p>
91a210d3b66a examples: relpipe-tr-grep
František Kučera <franta-hg@frantovo.cz>
parents: 207
diff changeset
    43
		
87
25dec6931f18 Lepší odsazení, tabulátory.
František Kučera <franta-hg@frantovo.cz>
parents: 23
diff changeset
    44
	</text>
4
1bb39595a51c genrování hlavní nabídky #1
František Kučera <franta-hg@frantovo.cz>
parents: 2
diff changeset
    45
1
a05c6f3cbc3e základ, první verze
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
</stránka>