简体   繁体   English

linux 中的 awk 命令中的 {} 有什么用?

[英]what is the use of {} in awk command in linux?

I ran below command on Linux terminal, it works, just interested in knowing how {} works?我在 Linux 终端上运行了以下命令,它可以工作,只是想知道 {} 是如何工作的? example:-例子:-

who | awk '{ if($1 == "name") {print}}' 

Programs in awk are composed of statements of the form: awk 中的程序由以下形式的语句组成:

pattern { action }模式{动作}

so the stuff in the {} is an action to be carried out, when filtering the text that awk is processing所以 {} 中的内容是在过滤 awk 正在处理的文本时要执行的操作

See https://www.gnu.org/software/gawk/manual/gawk.html for a full guide to the GNU version of awk that is found on most Linux systems See https://www.gnu.org/software/gawk/manual/gawk.html for a full guide to the GNU version of awk that is found on most Linux systems

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM