I have a simple command like this grep 'X' results.dat | awk '{print $NF}'  > Y.datI want to loop this command taking the Xs from column 1 and the corresponding Ys from column 2 of the same file eg. NAMES NAMES file has the formatC11-C12     p01C13-C14-C17 P02etc ..so the first two steps in the loop should be like thisgrep 'C11-C12' results.dat | awk '{print $NF}'  > p01.datgrep 'C13-C14-C17' results.dat | awk '{print $NF}'  > p02.dat
How to loop a command through a file column values?
bash;shell script;text processing