I am trying to find strings from one file in another file and I need to have the search string printed once, and the lines for matches following.
The strings I want to find matches for are in a file with 2 lines per record, no empty lines etc. Line 1 contains the name, line 2 the string I need to find in the second file.
sed -n '1~2p' will print all the names, but I will need to print only the first name, pass the value of the second line to grep, execute the grep command, then print the second record's name (line 3), pass line 4 to grep and so on.
An alternative would be to use a
until loop with a counter incremented by 2, but then I don't know how to pass the value of counter to