I need to grep
for string containing special characters and make sure it is at the end of the line
For example, in list:
abc defg[h]ij
I want to grep fordefg[h]ij$
xyz 123*456
I want to grep for123*456$
The search string and possible match containing special characters are varying, thus a fixed masking is not possible.
I am looking for something like grep -F
in combination with the end of line $
anchor. -w
will not suffice, it must be end of line.