Article 56MQX [SOLVED] Variables and quotes in bash

[SOLVED] Variables and quotes in bash

by
iicapn
from LinuxQuestions.org on (#56MQX)
I'm trying to run this command but having trouble with the variable part:

Code:echo '/^From:[[:space:]]+(.*)/ REPLACE From: "$hostname" hi.there@gmail.com' > /etc/postfix/header_checkI want the $hostname to be replaced with the variable I set earlier (while keeping the double quotes). But it's being written to the file as the string literal $hostname

Would very much appreciate some tips on how best to think about how to solve this. Thank you!latest?d=yIl2AUoC8zA latest?i=BjgguW8_uwo:HDpIlJLXaV0:F7zBnMy latest?i=BjgguW8_uwo:HDpIlJLXaV0:V_sGLiP latest?d=qj6IDK7rITs latest?i=BjgguW8_uwo:HDpIlJLXaV0:gIN9vFwBjgguW8_uwo
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments