test
This commit is contained in:
@@ -3,4 +3,4 @@
|
||||
file="/config/vhclient.ini"
|
||||
touch $file
|
||||
|
||||
awk -f vh_editini.awk -v section=$1 -v key=$2 -v value=$3 $file
|
||||
awk -f /usr/bin/vh_editini.awk -v section=$1 -v key=$2 -v value=$3 $file
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
#!/usr/bin/awk -f
|
||||
|
||||
BEGIN {
|
||||
found_section = false;
|
||||
found_section = 0;
|
||||
found_key = 0;
|
||||
}
|
||||
|
||||
0$ ~ "^\[" $section {
|
||||
found_section = true;
|
||||
$0 ~ "^\\[" section "\\]" {
|
||||
found_section = 1;
|
||||
}
|
||||
|
||||
$0 ~ "^\\[" key "\\]" {
|
||||
if (found_section)
|
||||
found_key = 1;
|
||||
}
|
||||
|
||||
/.*/ {
|
||||
print $0;
|
||||
}
|
||||
|
||||
END {
|
||||
print "Found section: $found_section";
|
||||
print "Found section: " section " " found_section " and " key " " found_key;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user