linux - Bash ignore the $ -


i have bash script echo's in postfix main.cf file

ipadd=$(ifconfig  | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}') cat << eog > /etc/postfix/main.cf # local pathname information queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix  # queue , process ownership mail_owner = postfix # sending mail myorigin = $mydomain  # receiving mail mydestination = $myhostname localhost.$mydomain localhost $mydomain # trust , relay control mynetworks_style = host smtp_bind_address = $ipadd inet_interfaces = $ipadd, 127.0.0.1  eog 

the problem once run script, strips out "$mydomain" from:

 # sending mail     myorigin = $mydomain 

and strips out "$myhostname" , "$mydomain" from

# receiving mail     mydestination = $myhostname localhost.$mydomain localhost $mydomain 

i $ipadd work , run, ignore "$" infront of $mydomain , $myhostname.

is possible?

cat << 'eog' > /etc/postfix/main.cf # other stuff myorigin = $mydomain # other stuff eog 

here document


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -