📄 manpage
字号:
.ds PX \s-1POSIX\s+1.ds UX \s-1UNIX\s+1.ds AN \s-1ANSI\s+1.TH GAWK 1 "May 28 1991" "Free Software Foundation" "Utility Commands".SH NAMEgawk \- pattern scanning and processing language.SH SYNOPSIS.B gawk[.B \-W.I gawk-options] [.BI \-F\^ fs] [.B \-v.IR var = val].B \-f.I program-file[.B \-\^\-] file .\^.\^..br.B gawk[.B \-W.I gawk-options] [.BI \-F\^ fs] [.B \-v.IR var = val] [.B \-\^\-].I program-textfile .\^.\^..SH DESCRIPTION.I Gawkis the GNU Project's implementation of the AWK programming language.It conforms to the definition of the language inthe \*(PX 1003.2 Command Language And Utilities Standard(draft 11).This version in turn is based on the description in.IR "The AWK Programming Language" ,by Aho, Kernighan, and Weinberger,with the additional features defined in the System V Release 4 versionof \*(UX.IR awk ..I Gawkalso provides some GNU-specific extensions..PPThe command line consists of options to.I gawkitself, the AWK program text (if not supplied via the.B \-foption), and values to be madeavailable in the.B ARGCand.B ARGVpre-defined AWK variables..SH OPTIONS.PP.I Gawkaccepts the following options, which should be available on any implementationof the AWK language..TP.BI \-F fsUse.I fsfor the input field separator (the value of the.B FSpredefinedvariable)..TP\fB\-v\fI var\fR\^=\^\fIval\fRAssign the value.IR val ,to the variable.IR var ,before execution of the program begins.Such variable values are available to the.B BEGINblock of an AWK program..TP.BI \-f " program-file"Read the AWK program source from the file.IR program-file ,instead of from the first command line argument.Multiple.B \-foptions may be used..TP.B \-\^\-Signal the end of options. This is useful to allow further arguments to theAWK program itself to start with a ``\-''.This is mainly for consistency with the argument parsing convention usedby most other \*(PX programs..PPFollowing the \*(PX standard,.IR gawk -specificoptions are supplied via arguments to the.B \-Woption. Multiple.B \-Woptions may be supplied, or multiple arguments may be supplied togetherif they are separated by commas, or enclosed in quotes and separatedby white space.Case is ignored in arguments to the.B \-Woption..PPThe.B \-Woption accepts the following arguments:.TP \w'\fBcopyright\fR'u+1n.B compatRun in.I compatibilitymode. In compatibility mode,.I gawkbehaves identically to \*(UX.IR awk ;none of the GNU-specific extensions are recognized..TP.PD 0.B copyleft.TP.PD.B copyrightPrint the short version of the GNU copyright information message onthe error output..TP.B lintProvide warnings about constructs that aredubious or non-portable to other AWK implementations..TP.B posixThis turns on.I compatibility mode, with the following additional restrictions:.RS.TP \w'\(bu'u+1n\(bu.B \exescape sequences are not recognized..TP\(buThe synonym.B funcfor the keyword.B functionis not recognized..TP\(buThe operators.B **and.B **=cannot be used in place of.B ^and.BR ^= ..RE.TP.B versionPrint version information for this particular copy of.I gawkon the error output.This is useful mainly for knowing if the current copy of.I gawkon your systemis up to date with respect to whatever the Free Software Foundationis distributing..PPAny other options are flagged as illegal, but are otherwise ignored..SH AWK PROGRAM EXECUTION.PPAn AWK program consists of a sequence of pattern-action statementsand optional function definitions..RS.PP\fIpattern\fB { \fIaction statements\fB }\fR.br\fBfunction \fIname\fB(\fIparameter list\fB) { \fIstatements\fB }\fR.RE.PP.I Gawkfirst reads the program source from the.IR program-file (s)if specified, or from the first non-option argument on the command line.The.B \-foption may be used multiple times on the command line..I Gawkwill read the program text as if all the.IR program-file shad been concatenated together. This is useful for building librariesof AWK functions, without having to include them in each new AWK
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -