Linux常用命令 awk 入门基础教程(2)

[linuxmi@linux:~/linuxmi迷]$ awk 'BEGIN{ a=9;b=8;print"(a + b)=",(a + b)}'
(a + b)= 17
[linuxmi@linux:~/linuxmi迷]$ awk 'BEGIN{ a=100;b=78;print"(a - b)=",(a - b)}'
(a - b)= 22
[linuxmi@linux:~/linuxmi迷]$ awk 'BEGIN{ a=80;b=5;print"(a / b)=",(a / b)}'
(a / b)= 16
[linuxmi@linux:~/linuxmi迷]$ awk 'BEGIN{ a=80;b=5;print"(a ÷ b)=",(a /  b)}'
(a ÷ b)= 16
[linuxmi@linux:~/linuxmi迷]$ awk 'BEGIN{ a=10;b=9;print"(a × b)=",(a * b)}'
(a × b)= 90

如下图:

Linux常用命令 awk 入门基础教程

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/11572.html