# HG changeset patch # User František Kučera # Date 1544108792 -3600 # Node ID 6cd2e54d90ea0a304ce5c76f90558d365f542e5d # Parent 9ad44348e6aa0ded040ab5be06a4c0bacc2bac78 examples: relpipe-in-cli diff -r 9ad44348e6aa -r 6cd2e54d90ea relpipe-data/examples.xml --- a/relpipe-data/examples.xml Thu Dec 06 15:13:28 2018 +0100 +++ b/relpipe-data/examples.xml Thu Dec 06 16:06:32 2018 +0100 @@ -9,6 +9,118 @@ +

relpipe-in-cli: Hello Wordl!

+ +

+ Let's start with and obligatory Hello World example. +

+ + + +

+ This command generates relational data. + In order to see them, we need to convert them to some other format. + For now, we will use the "tabular" format and pipe relational data to the relpipe-out-tabular. +

+ + + +

Output:

+ +
+ +

+ The syntax is simple as we see above. We specify the name of the relation, number of attributes, + and then their definitions (names and types), + followed by the data. +

+ +

relpipe-in-cli: STDIN

+ +

+ The number of CLI arguments is limited and their are passed at once to the process. + So there is option to pass the values from STDIN instead of CLI arguments. + Values on STDIN are expected to be separated by the null-byte. + We can generate such data e.g. using echo and tr (or using printf or other commands): +

+ + + +

+ The output is same as above. + We can use this approach to convert various formats to relational data. + There are lot of data already in the form of null-separated values e.g. the process arguments: +

+ + + +

If we have mc /etc/ /tmp/ running in some other terminal, the output will be:

+ +
+ +

+ Also the find command can produce data separated by the null-byte: +

+ + + +

Will display something like this:

+ +
+ +

relpipe-tr-validator