I want to create a egrep variable from a file.
For example:
string=`cat query.txt`
cat myfile.txt | egrep "$string"
The string variable file has a list of one or multiple lines
So the end result of:
cat myfile.txt | egrep "$string"
would be:
cat myfile.txt | egrep "test1|test20|test33"
I can not figure out how to read the file line by line and put a | between all but the last line and if the file only has one entry, to not put any |