<分区>
我正在从文件 appliances_list.txt 中读取一个字符串。
appliances_list.txt 包含
fridge
dryer
ironbox
microwave
我正在阅读的文件是 myappliances.txt。内容是
I have a fridge
I have another fridge
I have a refridgerator
I have a microwave
I have ironbox at home
I have another microwave
I have a hairdryer
我在用
grep -o -m1 -f appliances_list.txt myappliances.txt
输出是
冰箱
我想要的输出是每个字符串的第一次出现(完全匹配)
fridge
microwave
ironbox
有人能指出我正确的方向吗?