relpipe-data/examples.xml
branchv_0
changeset 233 a8029bd1c87a
parent 232 c7d05cf04b76
child 234 2fc56dd7f003
equal deleted inserted replaced
232:c7d05cf04b76 233:a8029bd1c87a
    12 		<p>
    12 		<p>
    13 			All examples were tested in <a href="https://www.gnu.org/software/bash/">GNU Bash</a>.
    13 			All examples were tested in <a href="https://www.gnu.org/software/bash/">GNU Bash</a>.
    14 			But they should also work in other shells.
    14 			But they should also work in other shells.
    15 		</p>
    15 		</p>
    16 		
    16 		
    17 		<h3>relpipe-in-cli: Hello Wordl!</h3>
    17 		<h2>relpipe-in-cli: Hello Wordl!</h2>
    18 		
    18 		
    19 		<p>
    19 		<p>
    20 			Let's start with an obligatory Hello World example.
    20 			Let's start with an obligatory Hello World example.
    21 		</p>
    21 		</p>
    22 		
    22 		
    84  ├────────────┤
    84  ├────────────┤
    85  │ world      │
    85  │ world      │
    86  ╰────────────╯
    86  ╰────────────╯
    87 Record count: 1]]></pre>
    87 Record count: 1]]></pre>
    88 		
    88 		
    89 		<h3>relpipe-in-cli: STDIN</h3>
    89 		<h2>relpipe-in-cli: STDIN</h2>
    90 		
    90 		
    91 		<p>
    91 		<p>
    92 			The number of <abbr title="Command-line interface">CLI</abbr> arguments is limited and they are passed at once to the process.
    92 			The number of <abbr title="Command-line interface">CLI</abbr> arguments is limited and they are passed at once to the process.
    93 			So there is option to pass the values from STDIN instead of CLI arguments.
    93 			So there is option to pass the values from STDIN instead of CLI arguments.
    94 			Values on STDIN are expected to be separated by the null-byte.
    94 			Values on STDIN are expected to be separated by the null-byte.
   151  │ /etc/ssh/ssh_host_rsa_key.pub     │
   151  │ /etc/ssh/ssh_host_rsa_key.pub     │
   152  ╰───────────────────────────────────╯
   152  ╰───────────────────────────────────╯
   153 Record count: 9]]></pre>
   153 Record count: 9]]></pre>
   154 		
   154 		
   155 		
   155 		
   156 		<h3>relpipe-in-fstab</h3>
   156 		<h2>relpipe-in-fstab</h2>
   157 		
   157 		
   158 		<p>
   158 		<p>
   159 			Using command <code>relpipe-in-fstab</code> we can convert the <code>/etc/fstab</code> or <code>/etc/mtab</code> to relational data 
   159 			Using command <code>relpipe-in-fstab</code> we can convert the <code>/etc/fstab</code> or <code>/etc/mtab</code> to relational data 
   160 		</p>
   160 		</p>
   161 		
   161 		
   187 		
   187 		
   188 		<p>
   188 		<p>
   189 			n.b. the <code>relpipe-in-fstab</code> reads the <code>/etc/fstab</code> if executed on TTY. Otherwise, it reads the STDIN.
   189 			n.b. the <code>relpipe-in-fstab</code> reads the <code>/etc/fstab</code> if executed on TTY. Otherwise, it reads the STDIN.
   190 		</p>
   190 		</p>
   191 		
   191 		
   192 		<h3>relpipe-out-xml</h3>
   192 		<h2>relpipe-out-xml</h2>
   193 		
   193 		
   194 		<p>
   194 		<p>
   195 			Relational data can be converted to various formats and one of them is the XML.
   195 			Relational data can be converted to various formats and one of them is the XML.
   196 			This is a good option for further processing e.g. using XSLT transformation or passing the XML data to some other tool.
   196 			This is a good option for further processing e.g. using XSLT transformation or passing the XML data to some other tool.
   197 			Just use <code>relpipe-out-xml</code> instead of <code>relpipe-out-tabular</code> and the rest of the pipeline remains unchanged:
   197 			Just use <code>relpipe-out-xml</code> instead of <code>relpipe-out-tabular</code> and the rest of the pipeline remains unchanged:
   263 		<p>
   263 		<p>
   264 			n.b. the format is not final and will change i future versions (XML namespace, more metadata etc.).
   264 			n.b. the format is not final and will change i future versions (XML namespace, more metadata etc.).
   265 		</p>
   265 		</p>
   266 		
   266 		
   267 		
   267 		
   268 		<h3>relpipe-tr-validator</h3>
   268 		<h2>relpipe-tr-validator</h2>
   269 		
   269 		
   270 		<p>
   270 		<p>
   271 			Just a passthrough command, so these pipelines should produce the same hash:
   271 			Just a passthrough command, so these pipelines should produce the same hash:
   272 		</p>
   272 		</p>
   273 		
   273 		
   293 		<p>
   293 		<p>
   294 			If an error is found, it is reported on STDERR. So just omit the <code>&amp;</code> in order to see the error message.
   294 			If an error is found, it is reported on STDERR. So just omit the <code>&amp;</code> in order to see the error message.
   295 		</p>
   295 		</p>
   296 		
   296 		
   297 		
   297 		
   298 		<h3>/etc/fstab formatting using -in-fstab, -out-nullbyte, xargs and Perl</h3>
   298 		<h2>/etc/fstab formatting using -in-fstab, -out-nullbyte, xargs and Perl</h2>
   299 		
   299 		
   300 		<p>
   300 		<p>
   301 			As we have seen before, we can convert <code>/etc/fstab</code> (or <code>mtab</code>)
   301 			As we have seen before, we can convert <code>/etc/fstab</code> (or <code>mtab</code>)
   302 			to e.g. an XML or a nice and colorful table using <m:name/>.
   302 			to e.g. an XML or a nice and colorful table using <m:name/>.
   303 			But we can also convert these data back to the <code>fstab</code> format. And do it with proper indentation/padding.
   303 			But we can also convert these data back to the <code>fstab</code> format. And do it with proper indentation/padding.