-Edit- This isn't a duplicate because I'm using one file to compare another everything I found on SO is looping through one file without an input file to compare.
A list of filenames.csv looks like this:
"aaabbccdd-3ksdfs"
"asdfdsbh-kkdkdsd"
"asdfds123221sssa"
I have another onelongstring.txt that that only has one massive string:
asfdsafsdafs//sdfasdschasdjs//akdasdfshcie//asdfdsbh-kkdkdsd...
What I would like to know is if each of the values in filesnames.csv exist in onelongstring.txt.
I tried something like this:
for i in filename.csv; do grep $i onelongstring.txt > countiffound.txt
But it wasn't working, then I realized if I just tried to do a loop like this:
for i in filename.csv; do echo $i;done
My output would just be the name of the file rather than each line of the content.
Is there a way to do this on the bash
command line (osx) instead of having to write a script in bash
?