andrea@amanda{~/scripts}: between
usage : between [-c] [-p] [-i] start=keyword1 end=keyword2 [file]
where :
-c : ignore comment lines (lines starting with #)
-p : keywords can match a partial line,
default is the keyword must match the entire line
-i : include the keyword lines,
default is not to print the keyword lines
note : regular expressions are ok for keywords (e.g '^begin', 'end$')
example: between start=START_SECTION end=END_SECTION config
will print lines between START_SECTION and END_SECTION
andrea@amanda{~/scripts}: between -i -p start='^function' end='^}' between
function printline(line) {
if (output == 1) print line
}
function printmatch(line) {
if (include == "yes")
printline(line)
}
function matchline(line, token) {
if (partial == "yes") {
if (match(line, token)) return 1
} else {
if (line == token) return 1
}
return 0
}