A question about awk# Unix - 噫吁兮,危乎高哉
c*e
1 楼
用 awk 是不是只能读文件内容,而不能修改文件内容?
我用awk来实现把 backuptimes 加 1 的功能.我是这样写的:
awk '/backuptimes/{$2+=1;print}' logfile
print的结果是加 1 后的,但是文件的内容并没有改变,也就是没有加 1 .
难道awk不能改文件?
我用awk来实现把 backuptimes 加 1 的功能.我是这样写的:
awk '/backuptimes/{$2+=1;print}' logfile
print的结果是加 1 后的,但是文件的内容并没有改变,也就是没有加 1 .
难道awk不能改文件?