[root@localhost weihu1]# cat test.txt
/etc/nginx/conf/wwwblackip.conf
/etc/nginx/bss_acl/bss_acl.conf
/etc/nginx/conf/whiteip.conf
/etc/nginx/conf/apiwhitelist.conf
/etc/nginx/api_acl/api_acl.conf
[root@localhost weihu1]# cat ip.txt
121.40.157.124
124.70.195.36
223.68.188.170
cat t.sh
#!/bin/bash
for i in `cat ip.txt`
do
for x in `cat test.txt`
do
grep -l $i $x
grep $i $x
done
done
实现效果如下;
标签:grep,批量,etc,查找文件,cat,nginx,conf,acl From: https://www.cnblogs.com/cherishthepresent/p/17759661.html