加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (https://www.0577zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

awk - Unix, Linux Command---reference

发布时间:2021-01-30 02:45:05 所属栏目:Linux 来源:网络整理
导读:副标题#e# http://www.tutorialspoint.com/unix_commands/awk.htm gawk - pattern scanning and processing language gawk?[?POSIX?or?GNU?style options ]?-f? program-file ?[?--?] file ...?gawk?[?POSIX?or?GNU?style options ] [?--?]? program-text ?
副标题[/!--empirenews.page--]

http://www.tutorialspoint.com/unix_commands/awk.htm

gawk - pattern scanning and processing language

gawk?[?POSIX?or?GNU?style options ]?-f?program-file?[?--?] file ...?gawk?[?POSIX?or?GNU?style options ] [?--?]?program-text?file ...

pgawk?[?POSIX?or?GNU?style options ]?-f?program-file?[?--?] file ...?pgawk?[?POSIX?or?GNU?style options ] [?--?]?program-text?file ...

Gawk?is the?GNU?Project’s implementation of the?AWK?programming language. It conforms to the definition of the language in the?POSIX?1003.2 Command Language And Utilities Standard. This version in turn is based on the description in?The AWK Programming Language,by Aho,Kernighan,and Weinberger,with the additional features found in the System V Release 4 version of?UNIX?awk.?Gawk?also provides more recent Bell Laboratories?awk?extensions,and a number of?GNU-specific extensions.

Pgawk?is the profiling version of?gawk. It is identical in every way to?gawk,except that programs run more slowly,and it automatically produces an execution profile in the fileawkprof.out?when done. See the?--profile?option,below.

The command line consists of options to?gawk?itself,the?AWK?program text (if not supplied via the?-f?or?--file?options),and values to be made available in the?ARGC?andARGV?pre-defined?AWK?variables.

Gawk?options may be either traditional?POSIX?one letter options,or?GNU?style long options.?POSIX?options start with a single ‘‘-’’,while long options start with ‘‘--’’. Long options are provided for both?GNU-specific features and for?POSIX-mandated features.

Following the?POSIX?standard,?gawk-specific options are supplied via arguments to the?-W?option. Multiple?-W?options may be supplied Each?-W?option has a corresponding long option,as detailed below. Arguments to long options are either joined with the option by an?=?sign,with no intervening spaces,or they may be provided in the next command line argument. Long options may be abbreviated,as long as the abbreviation remains unique.

Gawk?accepts the following options,listed alphabetically.

?fs?--field-separator?fsfs?for the input field separator (the value of the?FSpredefined variable).</tr>
<tr valign="top">
<td colspan="2">
-v?var=val?--assign?var=val
</td>

</tr>
<tr valign="top">
<td width="6%">?</td>
<td>Assign the value?val?to the variable?var,before execution of the program begins. Such variable values are available to theBEGIN?block of an?AWK?program.</td>

</tr>
<tr valign="top">
<td colspan="2">
-f?program-file?--file?program-file
</td>

</tr>
<tr valign="top">
<td width="6%">?</td>
<td>Read the?AWK?program source from the file?program-file,instead of from the first command line argument. Multiple?-f?(or?--file) options may be used.</td>

</tr>
<tr valign="top">
<td>
-mf?NNN?-mr?NNN
</td>
<td valign="bottom">Set various memory limits to the value?NNN. The?f?flag sets the maximum number of fields,and the?r?flag sets the maximum record size. These two flags and the?-m?option are from the Bell Laboratories research version of?UNIX?awk. They are ignored bygawk,since?gawk?has no pre-defined limits.</td>

</tr>
<tr valign="top">
<td colspan="2">
-W compat?-W traditional?--compat?--traditional
</td>

</tr>
<tr valign="top">
<td width="6%">?</td>
<td>Run in?compatibility?mode. In compatibility mode,?gawk?behaves identically to?UNIX?awk; none of the?GNU-specific extensions are recognized. The use of?--traditional?is preferred over the other forms of this option. See?<a href="http://www.tutorialspoint.com/#34"&gt;GNU EXTENSIONS,below,for more information.</td>

</tr>
<tr valign="top">
<td colspan="2">
-W copyleft?-W copyright?--copyleft?--copyright
</td>

</tr>
<tr valign="top">
<td width="6%">?</td>
<td>Print the short version of the?GNU?copyright information message on the standard output and exit successfully.</td>

(编辑:温州站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

Description