X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=lib%2Fparseini.in;h=2f2124c49dd6137532302a7d11085e1d6c172bd3;hb=f4c1e7c822553209a0cac7999f8bac7fdedaa733;hp=6f56d4228dc3efd1e44ef556bcd46dd14713d262;hpb=a61c0a8b4533b87ff86b4bafdd5216fc10abfa51;p=matthijs%2Fupstream%2Fbackupninja-vserver.git diff --git a/lib/parseini.in b/lib/parseini.in index 6f56d42..2f2124c 100644 --- a/lib/parseini.in +++ b/lib/parseini.in @@ -1,3 +1,4 @@ +# -*- mode: awk; indent-tabs-mode: nil; -*- # # parseini --- parses 'ini' style configuration files. # @@ -8,27 +9,26 @@ # # example ini file: # -# fruit = apple -# fruit = pear -# multiline = this is a multiline \ -# parameter +# fruit = apple +# fruit = pear +# multiline = this is a multiline \ +# parameter # -# # this is a comment +# # this is a comment +# [colors] +# red = yes +# green = no +# blue = maybe # -# [colors] -# red = yes -# green = no -# blue = maybe -# -# [ocean] -# fish = red -# fish = blue +# [ocean] +# fish = red +# fish = blue # # example usage: -# > awk -f parseini S=ocean P=fish testfile.ini +# > awk -f parseini S=ocean P=fish testfile.ini # would return: -# red -# blue +# red +# blue # BEGIN { @@ -119,7 +119,7 @@ END { for (x = 0; x < nline; ++x) { sub(/^[ \r\t]+/, "", line[x]) sub(/[ \r\t]+$/, "", line[x]) - } + } # output the final result for (x = 0; x < nline; ++x)