Передать переменную в cat [дубликат]

prueba esto:

:set recolor-darkcolor \#839496

en el modo normal, o poner en ~/.config/zathura/zathurarc

2
31.05.2019, 19:41
1 ответ

Вам нужно снять кавычкиEOF:

If any part of word is quoted, the delimiter shall be formed by performing quote removal on word, and the here-document lines shall not be expanded. Otherwise, the delimiter shall be the word itself.

If no part of word is quoted, all lines of the here-document shall be expanded for parameter expansion, command substitution, and arithmetic expansion.

См.:2.7.4 Здесь -Документ


Обратите внимание, однако, что в вашем здесь документе есть несколько вещей, которые необходимо экранировать по отдельности, чтобы предотвратить расширение:

cat <<EOF > /etc/nginx/sites-available/default
server {
    listen 80 default_server; 
    listen [::]:80 default_server; 

    listen 443 ssl default_server; 
    listen [::]:443 ssl default_server; 

    root /vagrant/webroot; 

    index index.php; 

    server_name _; 

    ssl_certificate /etc/nginx/certs/vagrantbox.crt; 
    ssl_certificate_key /etc/nginx/certs/vagrantbox.key;  

    location / { 
        try_files \$uri \$uri/ /index.php?\$args; 
    } 

    location ~ \.php\$ { 
        try_files \$uri =404; 
        include fastcgi_params; 
        fastcgi_pass unix:/run/php/php${PHP_V}-fpm.sock; 
        fastcgi_index index.php; 
        fastcgi_intercept_errors on; 
        fastcgi_param SCRIPT_FILENAME 
        \$document_root\$fastcgi_script_name; 
    }
}
EOF
7
27.01.2020, 21:52

Теги

Похожие вопросы