I would like to grep a number of documents by using a set of search terms and to specify the number of characters after match. Here is what I tried
grep -F -o -P "$(<search.txt).{0,4}" foo.txt
but I get the message 'grep: conflicting matchers specified' because -F and '-oP' cannot be combined. It does not work with '-E' either.
search.txtexactly? What sort of match are you trying to do exactly?{0,4}is a modifier for the atom directly before it (so to match whatever you get out ofsearch.txtand four more characters you need.{0,4}).search.txtcontains a list of terms and names. You're right with.{0,4}I made a mistake above, I'll correct it.echoin front of that command and this command, do you find a difference?