1、请问如何从一个关键字文本集合里用grep批量筛选另一个文本?
grep -f seed.txt file.txt
grep -vf seed.txt file.txt
可扩展:
#!/bin/bash
for file in ~/zjx/order_succ/*
do
#filename=$(basename $file)
cat $file | while read line
do
echo ${line}|awk -F ',' '{print $2}' >> oo.txt
done
done
echo 'finish oo.txt!'
cd ~/zjx/
for file2 in ~/zjx/log/*
do
#filename=$(basename $file2)
grep -vf oo.txt $file2 >> other_result.txt
done
echo 'finish other_result.txt!'