Variables inside single quotes ' don't get expanded by POSIX compatible shells, so using a shell variable in a sed substitution requires the use of double quotes " instead of single quotes ':
$ var="he"
$ echo "hello" | sed "s/$var/XX/"
XXllo
$ var="he&q...