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

awk - Unix, Linux Command---reference

发布时间:2021-01-24 20:35:25 所属栏目:Linux 来源:网络整理
导读: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-
Control Statements

The control statements are as follows:

<table class="src" cellspacing="5" cellpadding="5">

<tr>
<td>

if (condition) statement [ else statement ]
while (condition) statement 
do statement while (condition)
for (expr1; expr2; expr3) statement
for (var in array) statement
break
continue
delete array[index]
delete array
exit [ expression ]
{ statements }
I/O Statements

The input/output statements are as follows:

<table class="src" border="1" cellspacing="0" cellpadding="5">


<tr>
<th width="25%">Tag

file?[,?how]) how?should only be used when closing one end of a two-way pipe to a co-process. It must be a string value,either?"to"?or?"from".filefile; set?NF.?varvar?from next input record; set?NR,?FNR.?var?<filevar?from next record of?file.command?| getline?[var]command?piping the output either into?$0?or?var,as above.command?|& getline?[var]command?as a co-process piping the output either into?$0or?var,as above. Co-processes are a?gawk?extension.?expr-list?expr-list?>filefile. Each expression is separated by the value of the?OFS?variable. The output record is terminated with the value of the?ORS?variable.?fmt,expr-list?fmt,expr-list?>filefile.cmd-line) cmd-line,and return the exit status. (This may not be available on non-POSIX?systems.)file]) file. If?file?is missing,then standard output is flushed. If?file?is the null string,then all open output files and pipes have their buffers flushed.(编辑:晋中站长网)

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

</tr>
<tr valign="top">
<td>~ !~</td>
<td valign="bottom">Regular expression match,negated match.?NOTE:?Do not use a constant regular expression (/foo/) on the left-hand side of a?~or?!~. Only use one on the right-hand side. The expression/foo/ ~?exp?has the same meaning as?(($0 ~ /foo/) ~?exp). This is usually?not?what was intended.</td>

</tr>
<tr valign="top">
<td>in</td>
<td valign="bottom">Array membership.</td>

</tr>
<tr valign="top">
<td>&&</td>
<td valign="bottom">Logical AND.</td>

</tr>
<tr valign="top">
<td>||</td>
<td valign="bottom">Logical OR.</td>

</tr>
<tr valign="top">
<td>?:</td>
<td valign="bottom">The C conditional expression. This has the form?expr1???expr2?:expr3?. If?expr1?is true,the value of the expression is?expr2,otherwise it is?expr3. Only one of?expr2?and?expr3?is evaluated.</td>

</tr>
<tr valign="top">
<td>
= += -=?*= /= %= ^=
</td>
<td valign="bottom">Assignment. Both absolute assignment?(var?=?value)?and operator-assignment (the other forms) are supported.</td>

</tr>

Description
热点阅读