test
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
BEGIN {
|
||||
found_section = 0;
|
||||
found_key = 0;
|
||||
edited_row = 0;
|
||||
}
|
||||
|
||||
$0 ~ "^\\[" section "\\]" {
|
||||
@@ -12,6 +13,7 @@ $0 ~ "^\\[" section "\\]" {
|
||||
$0 ~ "^" key "=" {
|
||||
if (found_section) {
|
||||
found_key = 1;
|
||||
edited_row = 1;
|
||||
if (value) {
|
||||
print key "=" value;
|
||||
}
|
||||
@@ -21,6 +23,7 @@ $0 ~ "^" key "=" {
|
||||
$0 ~ "^\\[" {
|
||||
if (found_section && !found_key) {
|
||||
found_key = 1;
|
||||
edited_row = 1;
|
||||
if (value) {
|
||||
print key "=" value;
|
||||
}
|
||||
@@ -28,7 +31,7 @@ $0 ~ "^\\[" {
|
||||
}
|
||||
|
||||
/.*/ {
|
||||
if(!found_key) {
|
||||
if(!edited_row) {
|
||||
print $0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user