test
This commit is contained in:
@@ -9,15 +9,34 @@ $0 ~ "^\\[" section "\\]" {
|
||||
found_section = 1;
|
||||
}
|
||||
|
||||
$0 ~ "^\\[" key "\\]" {
|
||||
if (found_section)
|
||||
$0 ~ "^" key "=" {
|
||||
if (found_section) {
|
||||
found_key = 1;
|
||||
if (value) {
|
||||
print key "=" value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$0 ~ "^\\[" {
|
||||
if (found_section && !found_key) {
|
||||
found_key = 1;
|
||||
if (value) {
|
||||
print key "=" value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/.*/ {
|
||||
print $0;
|
||||
if(!found_key) {
|
||||
print $0;
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
print "Found section: " section " " found_section " and " key " " found_key;
|
||||
#print "Found section: " section " " found_section " and " key " " found_key;
|
||||
if (!found_section) {
|
||||
print "[" section "]";
|
||||
print key "=" value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user