我想打印满足 3 个条件的城市capital
:clean
和big
。
输入:
London is a big city
London is a capital
London is a clean city
Ohio is a big city
Sydney is a big city
Sydney is a clean city
Canberra is a capital
Canberra is a big city
Canberra is a clean city
NewYork is a big city
NewYork is a clean city
输出:
London
Canberra
我只需要满足所有三个条件的名称:大写、干净和大。
我尝试cut
将第一列放在单独文件中,然后为每个城市做grep name file|wc -l
,只取那些计数超过 3 的。如何在 Unix 中使用sed
or来完成awk
。