我有一个文件:AWK和正则表达式从文件
first basket with apple
second basket with apricota
third basket with tomato
fourth basket with olives
fifth empty basket
我必须打印包含在端/ E,O,Y /每个1,3,5.N字母串的每个单词。 结果必须是:苹果,番茄,空。 我可以单独1,3,5字符串,但不能在字符串每个字分开,并检查它
awk '{if (NR % 2 != 0); {if (/(y|e|o)$/) print $0}}' inputfile
,并在结果
first basket with apple