relpipe-data/examples-grep-cut-fstab.xml
branchv_0
changeset 325 4560c5623d7d
parent 301 7029e6c47700
child 326 ab7f333f1225
equal deleted inserted replaced
324:3cbce8bb28c3 325:4560c5623d7d
    26 			Assume that we need only <code>mount_point</code> fields from our <code>fstab</code> where <code>type</code> is <code>btrfs</code> or <code>xfs</code>
    26 			Assume that we need only <code>mount_point</code> fields from our <code>fstab</code> where <code>type</code> is <code>btrfs</code> or <code>xfs</code>
    27 			and we want to do something (a shell script block) with these directory paths.
    27 			and we want to do something (a shell script block) with these directory paths.
    28 		</p>
    28 		</p>
    29 		
    29 		
    30 		<m:pre jazyk="bash"><![CDATA[relpipe-in-fstab \
    30 		<m:pre jazyk="bash"><![CDATA[relpipe-in-fstab \
    31 	| relpipe-tr-grep 'fstab' 'type' '^btrfs|xfs$' \
    31 	| relpipe-tr-grep --relation 'fstab' --attribute 'type' --value '^btrfs|xfs$' \
    32 	| relpipe-tr-cut 'fstab' 'mount_point' \
    32 	| relpipe-tr-cut 'fstab' 'mount_point' \
    33 	| relpipe-out-nullbyte \
    33 	| relpipe-out-nullbyte \
    34 	| while read -r -d '' m; do
    34 	| while read -r -d '' m; do
    35 		echo "$m";
    35 		echo "$m";
    36 	done]]></m:pre>
    36 	done]]></m:pre>
   192 			And we can process it using this pipeline:
   192 			And we can process it using this pipeline:
   193 		</p>
   193 		</p>
   194 		
   194 		
   195 		<m:pre jazyk="bash"><![CDATA[cat tasks.csv \
   195 		<m:pre jazyk="bash"><![CDATA[cat tasks.csv \
   196 	| relpipe-in-csv \
   196 	| relpipe-in-csv \
   197 	| relpipe-tr-grep 'csv' 'type' 'FIXME' \
   197 	| relpipe-tr-grep --relation 'csv' --attribute 'type' --value 'FIXME' \
   198 	| relpipe-tr-cut 'csv' 'file|description' \
   198 	| relpipe-tr-cut 'csv' 'file|description' \
   199 	| relpipe-out-tabular]]></m:pre>
   199 	| relpipe-out-tabular]]></m:pre>
   200 	
   200 	
   201 		<p>and get result like this:</p>
   201 		<p>and get result like this:</p>
   202 	
   202