/^##include\s\w+/ { while ((getline line < $2) > 0) print line; close($2); next; } /^##insert\s+\w+/ { sub(/^##insert\s*/, ""); if (NF > 0) system($0); next; } // { print }