grep a space-separated list of string

view full story

http://forums.fedoraforum.org – Hi, How can I grep a space-separated list of strings from a file. For example, say I want to find the lines in file.txt that have the strings Monday or Tuesday in it. LOOKFOR="Monday Tuesday" grep $LOOKFOR file.txt (this doesn't work) I tried using grep -F but it requires the list to be separated by newlines (not spaces). Thanks, Rodrigo (HowTos)