Replace a text with a variable (sed) <p>How can I do this?</p> <pre><code>sed -i 's/wiki_host/$host_name/g' /root/bin/sync </code></pre> <p>It will replace wiki_host with the text $host_name. But i want to replace it with the content of the variable..</p> <p>I tried it with</p> <pre><code>sed -i 's/wiki_host/${host_name}/g' /root/bin/sync </code></pre> <p>It doesnt work too..</p>