⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extract.awk

📁 gawk: linux下资料处理工具
💻 AWK
字号:
# extract.awk --- extract files and run programs#                 from texinfo files## Arnold Robbins, arnold@skeeve.com, Public Domain# May 1993# Revised September 2000BEGIN    { IGNORECASE = 1 }/^@c(omment)?[ \t]+system/    \{    if (NF < 3) {        e = (FILENAME ":" FNR)        e = (e  ": badly formed `system' line")        print e > "/dev/stderr"        next    }    $1 = ""    $2 = ""    stat = system($0)    if (stat != 0) {        e = (FILENAME ":" FNR)        e = (e ": warning: system returned " stat)        print e > "/dev/stderr"    }}/^@c(omment)?[ \t]+file/    \{    if (NF != 3) {        e = (FILENAME ":" FNR ": badly formed `file' line")        print e > "/dev/stderr"        next    }    if ($3 != curfile) {        if (curfile != "")            close(curfile)        curfile = $3    }    for (;;) {        if ((getline line) <= 0)            unexpected_eof()        if (line ~ /^@c(omment)?[ \t]+endfile/)            break        else if (line ~ /^@(end[ \t]+)?group/)            continue        else if (line ~ /^@c(omment+)?[ \t]+/)            continue        if (index(line, "@") == 0) {            print line > curfile            continue        }        n = split(line, a, "@")        # if a[1] == "", means leading @,        # don't add one back in.        for (i = 2; i <= n; i++) {            if (a[i] == "") { # was an @@                a[i] = "@"                if (a[i+1] == "")                    i++            }        }        print join(a, 1, n, SUBSEP) > curfile    }}function unexpected_eof() {    printf("%s:%d: unexpected EOF or error\n",        FILENAME, FNR) > "/dev/stderr"    exit 1}END {    if (curfile)        close(curfile)}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -