Have a nice day I have got text file (zz.txt):
Chemical name 3-Aminopropane-1-sulphonic acid Synonym(s) -- Homotaurine * Tramiprosate -- Chemical name Common name and synonyms ...
I have variable s="Homotaurine * Tramiprosate"; I try to (un)select text of this variable from text file:
s="Homotaurine * Tramiprosate"; cat zz.txt | grep -i "$s"
s="Homotaurine * Tramiprosate";cat zz.txt | sed -ne "/$s/p"
Does not work. But if I change $s to, for instance, "Chemical name", everything ok, grep and sed work correctly and similarly. Variable $s received from another text file. Next time it could contain asterisk or not. Yes I realize that asterisk is very special character. How can I solve my task with sed/grep? And additional question - what others similar characters could create headache?