Using "grep -of file1.txt file2.txt" (file contents below), I get output:
and
if
pineapple
Why are 'dif' and 'for' missing? Do I have to use any other switches?
file1.txt
and
dif
for
if
apple
pineapple
file2.txt
andiforpineapple
|
Using "grep -of file1.txt file2.txt" (file contents below), I get output:
Why are 'dif' and 'for' missing? Do I have to use any other switches? file1.txt
file2.txt
|
|||
|
|
|
If you want to re-search the input file for each pattern specified:
However, this will have a different output line ordering than you apparently want, if the source file has more than one line. Since you've not said what you're using this for, I don't know if that will work for your actual problem. |
|||||||||||
|
|
Its like this:
|
|||||||||||
|