simple problem, I just cant seem to figure it out.. I've tried every combination of ' " \ that I have come across in similar threads on the forum but no luck..
I have 2 files
strings.txt: contains a list of numbers, 4 digits per line
file.txt: contains a lines that I want to grep for the strings.
for example:
>cat strings.txt
3214
8746
2411
>cat file.txt
freds phone number is 2411
janes phone number is 8746
carls phone number is 3214
this is what I'm using, but it isnt working.
Code:
#!/bin/bash
for i in $`cat strings.txt`; do
grep "$i" file.txt
done
if I
echo $i in the loop, I print out the contents of strings.txt
If I put
3214 in place of
grep "<$i>" file.txt I get "carls phone number is 3214"
but, together, it isnt doing anything...
thanks
-wick