Article 5803H how to check if I find a pattern with sed in loop

how to check if I find a pattern with sed in loop

by
mierdatuti
from LinuxQuestions.org on (#5803H)
Hi,
I have these code, to find values of a array in a file. The script only search in some lines number that the are in other file

Code:

while read -r Line; do

echo "Line $Line"

for i in "${patrones[@]}"
do


if [[ -n $(sed "${Line}!d;/'"${i}"'/I!d" $rutaFich/titles) ]]; then
echo "find it pattern $i en la linea $Line"
exit 0
else
echo "No encontrado el patron $i en linea $Line"
fi

done

done < $rutaFich/differencesBut not works. If find a pattern always goes to the else clause.
Any help please?
Thankslatest?d=yIl2AUoC8zA latest?i=ueVWzBUvzIM:wzyqMH28ClU:F7zBnMy latest?i=ueVWzBUvzIM:wzyqMH28ClU:V_sGLiP latest?d=qj6IDK7rITs latest?i=ueVWzBUvzIM:wzyqMH28ClU:gIN9vFwueVWzBUvzIM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments