001、
[root@pc1 test2]# ls a.txt [root@pc1 test2]# cat a.txt batch01 xyz1 batch02 xyz2 batch03 xyz3 batch04 xyz4 batch05 xyz5 [root@pc1 test2]# awk '{sub([0-9]+, "", $1); print $0}' a.txt awk: cmd. line:1: {sub([0-9]+, "", $1); print $0} awk: cmd. line:1: ^ syntax error awk: cmd. line:1: {sub([0-9]+, "", $1); print $0} awk: cmd. line:1: ^ syntax error [root@pc1 test2]# awk '{sub(/[0-9]+/, "", $1); print $0}' a.txt batch xyz1 batch xyz2 batch xyz3 batch xyz4 batch xyz5
标签:test2,sub,cmd,batch,awk,linux,txt From: https://www.cnblogs.com/liujiaxin2018/p/17731807.html