Problem is not with sed. Problem is with your shell. Variable substitution occurs in the shell and the result is then fed to the command you want to run; so, you need to allow the shell to do variable substitution in order for the command to work. Single quotes inhibit variable substitution, but double quotes allow it. In conclusion, as sol_nov accurately says, use double quotes.