#!/usr/bin/awk -f
# xmlrem.awk version 2 by Ben Collver <
[email protected]>
#
# reads XML from stdin and prints to stdout, removing <!-- -->
# comments
# OLD: foo<!-- <ABC/> -->bar
# NEW: <ABC/>
BEGIN {
RS = "-->"
}
match($0, /<!--/) {
pos = RSTART
str = substr($0, 1, pos-1)
printf "%s", str
next
}
{
printf "%s", $0
}