For starters, you can switch to double quotes:
sed "s/mytext/$var/"
Sometimes that does not work. It would depend on the exact value of
mytext. So another solution is to turn the single quoted string into two single quoted strings:
sed 's/mytext/'$var'/'
In this case, the 2nd single quoted string is '/'. Just using a backslash would work to that and it saves a character:
sed 's/mytext/'$var\/
There is actually no reason to quote a slash so this should also work with most shells:
sed 's/mytext/'$var/
And there may be no reason to quote anything at all, but again, the actual vakue of
mytext determines this. So this may work:
sed s/mytext/$var/
Opps...you only wanted
a solution, so I'll quit now....