include.awk
来自「正则表达式库」· AWK 代码 · 共 20 行
AWK
20 行
# Assume `source' is set with -vsource=filename on the command line.# /^\[\[\[/ { inclusion = $2; # name of the thing to include. printing = 0; while ((getline line < source) > 0) { if (match (line, "\\[\\[\\[end " inclusion "\\]\\]\\]")) printing = 0; if (printing) print line; if (match (line,"\\[\\[\\[begin " inclusion "\\]\\]\\]")) printing = 1; } close (source); next; } { print }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?