加入收藏 | 设为首页 | 会员中心 | 我要投稿 温州站长网 (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 ?
The?AWK?book does not define the return value of the?close()?function.?Gawk’s?close()returns the value from?fclose(3),or?pclose(3),when closing an output file or pipe,respectively. It returns the process’s exit status when closing an input pipe. The return value is -1 if the named file,pipe or co-process was not opened with a redirection.

When?gawk?is invoked with the?--traditional?option,if the?fs?argument to the?-F?option is ‘‘t’’,then?FS?is set to the tab character. Note that typing?gawk -Ft ...?simply causes the shell to quote the ‘‘t,and does not pass ‘‘t’’ to the?-F?option. Since this is a rather ugly special case,it is not the default behavior. This behavior also does not occur if?--posix?has been specified. To really get a tab character as the field separator,it is best to use single quotes:?gawk -F’t’ ....

If?gawk?is?configured?with the?--enable-switch?option to the?configure?command,then it accepts an additional control-flow statement:

</tr>
<tr valign="top">
<td>o</td>
<td valign="bottom">The?and(),?asort(),?asorti(),?bindtextdomain(),?compl(),dcgettext(),?dcngettext(),?gensub(),?lshift(),?mktime(),?or(),rshift(),?strftime(),?strtonum(),?systime()?and?xor()functions.</td>

</tr>
<tr valign="top">
<td>o</td>
<td valign="bottom">Localizable strings.</td>

</tr>
<tr valign="top">
<td>o</td>
<td valign="bottom">Adding new built-in functions dynamically with the?extension()function.</td>

</tr>

switch (expression) { case value|regex : statement ... [ default: statement ] }

The?AWKPATH?environment variable can be used to provide a list of directories thatgawk?searches when looking for files named via the?-f?and?--file?options.

If?POSIXLY_CORRECT?exists in the environment,then?gawk?behaves exactly as if?--posix?had been specified on the command line. If?--lint?has been specified,?gawk?issues a warning message to this effect.

getpid(2),?getppid(2),?getpgrp(2),?getuid(2),?geteuid(2),?getgid(2),?getegid(2),getgroups(2)

The AWK Programming Language,Alfred V. Aho,Brian W. Kernighan,Peter J. Weinberger,Addison-Wesley,1988. ISBN 0-201-07981-X.

GAWK: Effective AWK Programming,Edition 3.0,published by the Free Software Foundation,2001.

The?-F?option is not necessary given the command line variable assignment feature; it remains only for backwards compatibility.

Syntactically invalid single character programs tend to overflow the parse stack,generating a rather unhelpful message. Such programs are surprisingly difficult to diagnose in the completely general case,and the effort to do so really is not worth it.

The original version of?UNIX?awk?was designed and implemented by Alfred Aho,Peter Weinberger,and Brian Kernighan of Bell Laboratories. Brian Kernighan continues to maintain and enhance it.

Paul Rubin and Jay Fenlason,of the Free Software Foundation,wrote?gawk,to be compatible with the original version of?awk?distributed in Seventh Edition?UNIX. John Woods contributed a number of bug fixes. David Trueman,with contributions from Arnold Robbins,made?gawk?compatible with the new version of?UNIX?awk. Arnold Robbins is the current maintainer.

The initial DOS port was done by Conrad Kwok and Scott Garfinkle. Scott Deifik is the current DOS maintainer. Pat Rankin did the port to VMS,and Michal Jaegermann did the port to the Atari ST. The port to OS/2 was done by Kai Uwe Rommel,with contributions and help from Darrel Hankerson. Fred Fish supplied support for the Amiga,Stephen Davies provided the Tandem port,and Martin Brown provided the BeOS port.

This man page documents?gawk,version 3.1.5.

If you find a bug in?gawk,please send electronic mail to?. Please include your operating system and its revision,the version of?gawk?(from?gawk --version),what C compiler you used to compile it,and a test program and data that are as small as possible for reproducing the problem.

(编辑:温州站长网)

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

热点阅读