How to match a shell variable that contains parenthesis (and other special characters like "!")
file.txt contains:
Charles Dickens
Matthew Lewis (writer)
name="Matthew Lewis (writer)";
awk -v na="$name" ' $0 ~ na' file.txt
Ideally this would match $name in file.txt (in this case Matthew Lewis (writer)). But it doesn't work (gives an error) due to the parenthesis in $name. Is it possible to pass a shell variable that contains special characters in Awk's pattern section?