With an empty value the first expression adds a trailing opening
quote, so the second expression doesn't add the closing quote. Handle
this with a special case.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
# Override from the environment. This would be easier if env was
# guaranteed to quote its output so it could be reused.
- env | grep '^CTDB_' | sed -e 's@=\([^"]\)@="\1@' -e 's@[^"]$@&"@' >>"$conf"
+ env |
+ grep '^CTDB_' |
+ sed -e 's@=\([^"]\)@="\1@' -e 's@[^"]$@&"@' -e 's@="$@&"@' >>"$conf"
# We'll use "pkill -f" to kill the daemons with
# "ctdbd --sloppy-start --nopublicipcheck --nosetsched" as context.