Robert Moskowitz wrote:
On 2/5/19 10:41 AM, Ondrej Mosnacek wrote:
> cat >dovecot_mysql.te <<EOF
> policy_module(dovecot_mysql,1.0.0)
> gen_require(`
> type dovecot_t;
> ')
> mysql_read_config(dovecot_t)
> mysql_stream_connect(dovecot_t)
> EOF
For some reason this made an empty file. Don't know if it was the lack of
spaces on that first line? I use this myself a lot, but always put spaces
around the > and <<
No need for spaces after >. The issue with the above
example is that the HERE-DOC includes "`" chars which bash
tries to interpret. It should display an error like this
when you run it:
-bash: bad substitution: no closing "`" in `
To fix that, use:
cat >dovecot_mysql.te <<\EOF
...
The change is the \ preceding EOF, telling bash to not
perform parameter/command/arithmetic expansions on the
HERE-DOC contents.
--
Todd