$ cat data
Do NOT print me
START_MARKER
Print Me
END_MARKER
Do NOT print me
$ cat awk.sh
start=START_MARKER
end=END_MARKER
echo; echo Is this ugly syntax the only way?
awk '/'"$start"'/,/'"$end"'/ { print }' data
echo; echo Is there some modification of this that would work?
awk '/$start/,/$end/ { print }' start=$start end=$end data
$ ./awk.sh
Is this ugly syntax the only way?
START_MARKER
Print Me
END_MARKER
Is there some modification of this that would work?
Can anyone advise a way to avoid the relatively ugly glommed syntax? It's really not that ugly. Just want to know if a cleaner way. Using gawk, in case that matters.