155 |
155 |
156 <p> |
156 <p> |
157 n.b. the <code>relpipe-in-fstab</code> reads the <code>/etc/fstab</code> if executed on TTY. Otherwise, it reads the STDIN. |
157 n.b. the <code>relpipe-in-fstab</code> reads the <code>/etc/fstab</code> if executed on TTY. Otherwise, it reads the STDIN. |
158 </p> |
158 </p> |
159 |
159 |
|
160 <h3>relpipe-out-xml</h3> |
|
161 |
|
162 <p> |
|
163 Relational data can be converted to various formats and one of them is the XML. |
|
164 This is a good option for further processing e.g. using XSLT transformation or passing the XML data to some other tool. |
|
165 Just use <code>relpipe-out-xml</code> instead of <code>relpipe-out-tabular</code> and the rest of the pipeline remains unchanged: |
|
166 </p> |
|
167 |
|
168 <m:pre jazyk="bash"><![CDATA[ssh example.com cat /etc/mtab | relpipe-in-fstab | relpipe-out-xml]]></m:pre> |
|
169 |
|
170 <p> |
|
171 Will produce XML like this: |
|
172 </p> |
|
173 |
|
174 <m:pre jazyk="xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?> |
|
175 <pipe> |
|
176 <relation> |
|
177 <name>fstab</name> |
|
178 <record> |
|
179 <attribute>UUID</attribute> |
|
180 <attribute>29758270-fd25-4a6c-a7bb-9a18302816af</attribute> |
|
181 <attribute>/</attribute> |
|
182 <attribute>ext4</attribute> |
|
183 <attribute>relatime,user_xattr,errors=remount-ro</attribute> |
|
184 <attribute>0</attribute> |
|
185 <attribute>1</attribute> |
|
186 </record> |
|
187 <record> |
|
188 <attribute></attribute> |
|
189 <attribute>/dev/sr0</attribute> |
|
190 <attribute>/media/cdrom0</attribute> |
|
191 <attribute>udf,iso9660</attribute> |
|
192 <attribute>user,noauto</attribute> |
|
193 <attribute>0</attribute> |
|
194 <attribute>0</attribute> |
|
195 </record> |
|
196 <record> |
|
197 <attribute></attribute> |
|
198 <attribute>/dev/sde</attribute> |
|
199 <attribute>/mnt/data</attribute> |
|
200 <attribute>ext4</attribute> |
|
201 <attribute>relatime,user_xattr,errors=remount-ro</attribute> |
|
202 <attribute>0</attribute> |
|
203 <attribute>2</attribute> |
|
204 </record> |
|
205 <record> |
|
206 <attribute>UUID</attribute> |
|
207 <attribute>a2b5f230-a795-4f6f-a39b-9b57686c86d5</attribute> |
|
208 <attribute>/home</attribute> |
|
209 <attribute>btrfs</attribute> |
|
210 <attribute>relatime</attribute> |
|
211 <attribute>0</attribute> |
|
212 <attribute>2</attribute> |
|
213 </record> |
|
214 <record> |
|
215 <attribute></attribute> |
|
216 <attribute>/dev/mapper/sdf_crypt</attribute> |
|
217 <attribute>/mnt/private</attribute> |
|
218 <attribute>xfs</attribute> |
|
219 <attribute>relatime</attribute> |
|
220 <attribute>0</attribute> |
|
221 <attribute>2</attribute> |
|
222 </record> |
|
223 </relation> |
|
224 </pipe>]]></m:pre> |
|
225 |
|
226 <p> |
|
227 Thanks to XSLT, this XML can be easily converted e.g. to an XHTML table (<code>table|tr|td</code>) or other format. |
|
228 Someone can convert such data to a (La)TeX table. |
|
229 </p> |
|
230 |
|
231 <p> |
|
232 n.b. the format is not final and will change i future versions (XML namespace, more metadata etc.). |
|
233 </p> |
|
234 |
|
235 |
160 <h3>relpipe-tr-validator</h3> |
236 <h3>relpipe-tr-validator</h3> |
161 |
237 |
162 <p> |
238 <p> |
163 Just a passthrough command, so these pipelines should produce the same hash: |
239 Just a passthrough command, so these pipelines should produce the same hash: |
164 </p> |
240 </p> |