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
Comments
Post a Comment