Re: Problems with my simple write conf files method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]





On 02/21/2017 09:27 PM, Ian Mortimer wrote:
On Tue, 2017-02-21 at 10:50 -0500, Robert Moskowitz wrote:

cat <<EOF>/usr/share/postfixadmin/config.local.php || exit 1
<?php
$CONF['database_type'] = 'mysqli';
$CONF['database_user'] = 'postfix';
$CONF['database_password'] = 'xyz';
$CONF['database_name'] = 'postfix';

$CONF['configured'] = true;
?>
EOF
KMs method of escaping every $ in the here document works but a simpler
method is to escape the EOF.  That tells the shell not to do variable
expansion in the document:

    cat <<\EOF>/usr/share/postfixadmin/config.local.php || exit 1

Thank you. I actually had problems with changes to /etc/postfix/master.cf where I have things like ${sender} that do not work as \${sender}. So mass changes of $ to \$ did not always work. :)

Do I end with 'EOF' or \EOF'?


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
https://lists.centos.org/mailman/listinfo/centos



[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux