3 # Vypíše /etc/fstab ve formě XML souboru.
6 # aptitude install libxml-writer-perl
15 my $output = new IO::String->new($xml);
16 my $writer = new XML::Writer( OUTPUT => $output,
20 $writer->xmlDecl("UTF-8");
21 $writer->startTag("fstab");
24 open($fstab, "<", "/etc/fstab");
25 while (my $r = <$fstab>) {
26 if ($r !~ /^\x23/ && $r =~ /^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) {
27 $writer->startTag("bod");
28 $writer->dataElement("zařízení", "$1");
29 $writer->dataElement("přípojnýBod", "$2");
30 $writer->dataElement("souborovýSystém", "$3");
32 $writer->startTag("volby");
33 my @volby = split(",", $4);
34 foreach my $volba (@volby) {
35 $writer->dataElement("volba", "$volba");
39 $writer->dataElement("dump", "$5");
40 $writer->dataElement("pass", "$6");