加入收藏 | 设为首页 | 会员中心 | 我要投稿 晋中站长网 (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-

NOTE: When using the integer format-control letters for values that are outside the range of a C?long?integer,?gawk?switches to the?%g?format specifier. If?--lint?is provided on the command line?gawk?warns about this. Other versions of?awk?may print invalid values or do something else entirely.

Optional,additional parameters may lie between the?%?and the control letter:

count$ count’th argument at this point in the formatting. This is called a?positional specifier?and is intended primarily for use in translated versions of format strings,not in the original text of an AWK program. It is a?gawk?extension.spacewidthprecThe dynamic?width?and?prec?capabilities of the?ANSI?C?printf()?routines are supported. A*?in place of either the?width?or?prec?specifications causes their values to be taken from the argument list to?printf?or?sprintf(). To use a positional specifier with a dynamic width or precision,supply the?count$?after the?*?in the format string. For example,"%3$*2$.*1$s".

Special File Names

When doing I/O redirection from either?print?or?printf?into a file,or via?getline?from a file,?gawk?recognizes certain special filenames internally. These filenames allow access to open file descriptors inherited from?gawk’s parent process (usually the shell). These file names may also be used on the command line to name data files. The filenames are:

Description
nn.These are particularly useful for error messages. For example:

print "You blew it!" > "/dev/stderr"

whereas you would otherwise have to use

print "You blew it!" | "cat 1>&2"

(编辑:晋中站长网)

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

Description