在输入中删除每个'('一直到下一个')'的内容,在下一个')'之前遇到'('则停止删除$ echo 'a/b(division) + c%d() - (a#(b)2(' | awk '____________________'a/b + c%d - (a#2(
查看答案
对文件anchors.txt中的markdown链接进行格式转换$ cat anchors.txt# Regular Expressions## Subexpression calls$ awk '____________________' anchors.txt[Regular Expressions](#regular-expressions)[Subexpression calls](#subexpression-calls)
打印同时符合下列条件的行:包含professor(不区分大小写)包含quip或this(区分大小写)$ wget https://www.gutenberg.org/files/345/345.txt$ awk '____________________' 345.txtequipment of a professor of the healing craft. When we were shown in,should be. I could see that the Professor had carried out in this room,"Not up to this moment, Professor," she said impulsively, "but up toand sprang at us. But by this time the Professor had gained his feet,this time the Professor had to ask her questions, and to ask them pretty
输入包含由逗号(,)隔开的多个字段(字段值非空),请将第三个字段替换为42$ echo 'lion,ant,road,neon' | awk '____________________'lion,ant,42,neon
将输入行中倒数第4个so替换为X,仅打印被替换的行$ printf 'so and so also sow and soup' | awk '____________________'so and X also sow and soup