请根据输入输出填空,不能使用替换函数和字符串拼接函数(提示:使用内置变量FPAT指定字段模式)$ echo '("a 1""b""c-2""d")' | awk ____________________"a 1","c-2"
查看答案
请根据输入输出填空,不能使用替换函数,也不能显式使用print函数$ echo '1,2,3,4,5' | awk ____________________1,2,5
仅显示每行输入的第3和第5个字符$ echo -e 'restore\ncat one\ncricket' | awk ____________________sotoik
文件jumbled.txt中每行包含被各种不同分隔符分隔的单词,请打印出所有包含an或at或in或it 的单词,每行打印一个单词$ cat jumbled.txtovercoats;furrowing-typeface%pewter##hobbywavering:concession/woof\retailerjoint[]seer{intuition}titanic$ awk ____________________ jumbled.txtovercoatsfurrowingwaveringjointintuitiontitanic
用awk模拟命令”paste -sd,”$ cat addr.txtHello WorldHow are youThis game is goodToday is sunny12345You are funny# 将所有行用逗号','拼接起来$ paste -sd, addr.txtHello World,How are you,This game is good,Today is sunny,12345,You are funny# 请确保合并后行尾没有逗号','且行尾有换行$ awk ____________________ addr.txtHello World,How are you,This game is good,Today is sunny,12345,You are funny$ 如果输入仅有一行,也要确保合并后行尾没有逗号','$ printf 'foo' | paste -sd,foo$ printf 'foo' | awk ____________________foo