How can I write a heredoc to a file in Bash script?

前端 未结 9 994
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 12:33

How can I write a here document to a file in Bash script?

9条回答
  •  渐次进展
    2020-11-22 13:17

    For future people who may have this issue the following format worked:

    (cat <<- _EOF_
            LogFile /var/log/clamd.log
            LogTime yes
            DatabaseDirectory /var/lib/clamav
            LocalSocket /tmp/clamd.socket
            TCPAddr 127.0.0.1
            SelfCheck 1020
            ScanPDF yes
            _EOF_
    ) > /etc/clamd.conf
    

提交回复
热议问题