将addr.txt中每行的字母o的第一次出现替换为数字0$ awk '____________________' addr.txtHell0 WorldH0w are youThis game is g0odT0day is sunny12345Y0u are funny
查看答案
将输入中非单词边缘的42替换为[42]$ echo 'hi42bye nice421423 bad42 cool_42a 42c' | awk '____________________'hi[42]bye nice[42]1[42]3 bad42 cool_[42]a 42c
将输入中以s开头且以任意顺序包含e和t的单词用[]括起来$ echo 'sequoia subtle exhibit asset sets tests site' | awk '____________________'sequoia [subtle] exhibit asset [sets] tests [site]
将输入中以a或r结尾的单词后面的空格替换为换行符$ echo 'area not a _a2_ roar took 22' | awk '____________________'areanot a_a2_ roartook 22
将输入中的[4]|*全部替换为2$ echo '2.3/[4]|*6 foo 5.3-[4]|*9' | awk '____________________'2.3/26 foo 5.3-29