I'm working with a bash script trying to stop it from attempting to replace variables inside my heredoc. How do set a heredoc to either A) escape the variable names instead of parsing them or B) return the entire string untouched?
cat > /etc/nginx/sites-available/default_php <<END
server {
listen 80 default;
server_name _;
root /var/www/$host; <--- $host is a problem child
}
END
As is, when I it finishes injecting it into a file I'm left with this:
server {
listen 80 default;
server_name _;
root /var/www/;
}
From the
bash(1)
man page:Just with a backslash: