我的filename文件内容如下(例如): My block of line starts from here START First line second line third line END and end to here for example. 我想,以取代之间的行块START,并END只用一个词,例如用SINGLEWORD。如下所示: My block of line starts from here SINGLEWORD and end to here for example. 我可以使用以下命令找到我的代码行: grep -Pzo "START(.|\n)*END" filename 运行上述命令的结果将是这样的: START First line second line third line …
我正在编写的awk脚本中有几个命令: print "Here are some players and their numbers, sorted by last name" if(sum[x] > 500) {print x, $2} 哪个输出: Here are some players and their numbers, sorted by last name Lebron James 23 Kevin Durant 35 Kobe Bryant 24 Blake Griffin 32 Dikembe Mutumbo 55 如何在awk脚本中使用sort命令仅对玩家及其编号进行排序?