linux - grep 每个换行算1行,能不能以分号结束算1行呢?
迷茫
迷茫 2017-04-17 16:48:54
0
1
681

例如查找mysql的binlog,它是以分号算作一条的。grep默认是换行算一条。那就截断了。

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

répondre à tous(1)
小葫芦

echo "11;12;21" | sed 's/;/\n/g' | grep 2
OR
echo "11;12;21" | awk 'BEGIN{FS=";"} {print $0}' | grep 2

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!