linux 中awk命令同时指定多个分割符

 

001、

root@PC1:/home/test3# ls
a.txt
root@PC1:/home/test3# cat a.txt
e_r:e_y
k:e_g_x_3
1_3:e:g:e
root@PC1:/home/test3# awk -F "[_:]" '{print $2}' a.txt   ## 同时指定_和:作为分割符
r
e
3
root@PC1:/home/test3# awk -F "[_:]" '{print $4}' a.txt
y
x
g

 

posted @ 2022-07-22 23:33  小鲨鱼2018  阅读(411)  评论(0编辑  收藏  举报