I'm attempting to run a basic shell command/script on the command line. The purpose of this command is to read a file containing a list of symbols (one per line), then grep another file for each of those symbols (sending the output to another file):
for symbol in `cat matched_options.txt`; do grep $symbol, wombat.csv | sort; done
the comma after "$symbol" is required.
The file -- matched_options.txt -- contains one symbol per line. Each symbol is technically a pair of letters/numbers seperated by a single space, like so:
The problem is, it's reading each line as two different symbols:
Does anyone know how I can get it to read each line as one symbol?
Thanks in advance.