cat dai_cha.txt
http://adaminsys-yangboshi.com/login?redirect=%2Fdashboard
https://front-yangbshi.com/yybs
https://pmapi-gyangboshi.com/h5/index.html#/
http://nacos.ouxuan.com/nacos/#/login
182.92.64.122:443
121.132.27.36:3317
121.132.27.36:80
121.132.27.36:8283
149.224.7.150:443
149.224.7.150:9102
149.224.7.150:9099
149.224.7.150:80
149.196.94.12:443
149.196.94.12:9102
149.196.94.12:9099
146.15.8.248:443
cat test.txt
http://adaminsys-yangboshi.com/login?redirect=%2Fdashboard
https://front-yangbshi.com/yybs
https://pmapi-gyangboshi.com/h5/index.html#/
http://nacos.ouxuan.com/nacos/#/login
182.92.64.122:443
121.132.27.36:3317
121.132.27.36:80
121.132.27.36:8283
149.224.7.150:443
149.224.7.150:9102
149.224.7.150:9099
at Delete_row.sh
#!/bin/sh
set -x
cat test.txt|while read hash
do
sed -i '/'$hash'/d' dai_cha.txt
done
想法是 从test.txt 读取每一行的字符,如果字符在 dai_cha.txt 文件存在的,就删除 dai_cha.txt 的所在行
ip加端口的删除没有问题,但http://开头的无法删除,忘记 sed -i 删除行的是怎么转义http://的了,求帮助,谢谢!
请提供下http://行的转义字符说明,谢谢!
试过写成 sed -i '#'$hash'#d' dai_cha.txt 不行