I've got a list with 250 lines in it. I have to run all of them through a web server to get a list of output. This list, however returns many more lines, than I'm interested in. Say, my list.txt
is:
a.1
b.1
etc
then the output is output.txt
:
a.1 a b c
a.2 b a b
a.3 d k o
b.1 b o p
b.2 o i y
b.3 p i y
etc
Is it possible to use the grep command to search for all words in list.txt in the output.txt and then generate "the wanted" list wanted.txt? I need the entire line in my output.txt I'm new in scripting, but what I'd like is something such as
grep list.txt output.txt > wanted.txt
I haven't been able to find any examples of this