relpipe-data/examples-validator.xml
branchv_0
changeset 244 d4f401b5f90c
parent 241 f71d300205b7
equal deleted inserted replaced
243:9c1d0c5ed599 244:d4f401b5f90c
       
     1 <stránka
       
     2 	xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
       
     3 	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro">
       
     4 	
       
     5 	<nadpis>Validating relational data</nadpis>
       
     6 	<perex>check whether data are in the relpipe format</perex>
       
     7 	<m:pořadí-příkladu>00500</m:pořadí-příkladu>
       
     8 
       
     9 	<text xmlns="http://www.w3.org/1999/xhtml">
       
    10 		
       
    11 		<p>
       
    12 			Just a passthrough command, so these pipelines should produce the same hash:
       
    13 		</p>
       
    14 		
       
    15 		<m:pre jazyk="bash"><![CDATA[
       
    16 relpipe-in-fstab | relpipe-tr-validator | sha512sum
       
    17 relpipe-in-fstab | sha512sum]]></m:pre>
       
    18 
       
    19 		<p>
       
    20 			This tool can be used for testing whether a file contains valid relational data:
       
    21 		</p>
       
    22 		
       
    23 		<m:pre jazyk="bash"><![CDATA[
       
    24 if relpipe-tr-validator < "some-file.rp" &> /dev/null; then
       
    25 	echo "valid relational data";
       
    26 else
       
    27 	echo "garbage";
       
    28 fi]]></m:pre>
       
    29 		
       
    30 		<p>or as a one-liner:</p>
       
    31 		
       
    32 		<m:pre jazyk="bash"><![CDATA[relpipe-tr-validator < "some-file.rp" &> /dev/null && echo "ok" || echo "error"]]></m:pre>
       
    33 		
       
    34 		<p>
       
    35 			If an error is found, it is reported on STDERR. So just omit the <code>&amp;</code> in order to see the error message.
       
    36 		</p>
       
    37 		
       
    38 	</text>
       
    39 
       
    40 </stránka>