diff -r 9c1d0c5ed599 -r d4f401b5f90c relpipe-data/examples-grep-fstab.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/relpipe-data/examples-grep-fstab.xml Tue Feb 05 19:18:28 2019 +0100 @@ -0,0 +1,44 @@ + + + Filtering /etc/fstab using relpipe-tr-grep + list only records with desired filesystem types + 00900 + + + +

+ If we are interested only in certain records in some relation, we can filter it using relpipe-tr-grep. + If we want to list e.g. only Btrfs and XFS file systems from our fstab (see above), we will run: +

+ + + + +

and we will get following filtered result:

+
+ +

+ Command arguments are similar to relpipe-tr-sed. + Everything is a regular expression. + Only relations matching the regex will be filtered, others will flow through the pipeline unmodified. + If the attribute regex matches more attribute names, filtering will be done with logical OR + i.e. the record is included if at least one of that attributes matches the search regex. +

+ +

+ If we need exact match of the whole attribute, we have to use something like '^btrfs|xfs$', + otherwise mere substring-match is enough to include the record. +

+ +
+ +