Linux 常用命令工具

awk

工作流


1.读
2.执行
3.重复

程序结构

1.BEGIN block
2.记录处理结果
3.END block

语法

Usage: awk [POSIX or GNU style options] -f progfile [--] file ...
Usage: awk [POSIX or GNU style options] [--] 'program' file ...
POSIX options:		GNU long options: (standard)
	-f progfile		--file=progfile
	-F fs			--field-separator=fs
	-v var=val		--assign=var=val
Short options:		GNU long options: (extensions)
	-b			--characters-as-bytes
	-c			--traditional
	-C			--copyright
	-d[file]		--dump-variables[=file]
	-e 'program-text'	--source='program-text'
	-E file			--exec=file
	-g			--gen-pot
	-h			--help
	-L [fatal]		--lint[=fatal]
	-n			--non-decimal-data
	-N			--use-lc-numeric
	-O			--optimize
	-p[file]		--profile[=file]
	-P			--posix
	-r			--re-interval
	-S			--sandbox
	-t			--lint-old
	-V			--version

POSIX OPTIONS

-f : 可以将处理的模式放到一个文件里,使用这个参数进行加载
-v :为某个变量设定值

--dump-variables[=file] : 按序输出全局变量和他们的最终值到awkvar.out文件
-F :指定参数分割符

SHORT OPTIONS:

-L : 检查命令参数
-P :
-p : 在awkprof.out中生成一个可读性好的awk命令
-V :查看版本

posted @ 2022-04-13 17:38  Fake_coder  阅读(56)  评论(0编辑  收藏  举报