示例:
[root@henu1 ~]# vi marks.txt
1) George English 100
2) Didi English 100
3) George English 100
4) George English 100
5) George English 100
[root@henu1 ~]# awk 'BEGIN{printf "SrNo\tName\tSub\tMarks\n"} {print}' marks.txt
[root@henu1 ~]# awk '{print}' marks.txt
[root@henu1 ~]# vi command.awk
{print}
[root@henu1 ~]# awk -f command.awk marks.txt
基本用法:
log.txt文本内容如下:
2 this is a test
3 Are you like awk
This's a test
10 There are orange,apple,mong