From 5d8539c01a9e9a7311a017d546080d04e46a83e1 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Sat, 23 Apr 2022 13:27:02 +0200 Subject: [PATCH] fix(bin/emqx): make sed replace \n work in macos 10 --- bin/emqx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/emqx b/bin/emqx index ac459b6f7..bcb7622a0 100755 --- a/bin/emqx +++ b/bin/emqx @@ -356,7 +356,10 @@ generate_config() { ## transform a single line args list like '-config ... -args_file ... -vm_args ...' to lines and get path for each file respectively ## NOTE: the -args_file and -vm_args are the same file passed twice because args_file is used by beam, but not possible to get at runtime ## by calling init:get_arguments/0 - lines="$(echo "$CUTTLEFISH_OUTPUT" | tail -1 | sed 's/-config/\nconfig=/g' | sed 's/-args_file/\nargs_file=/g' | sed 's/-vm_args/\nvm_args=/g')" + lines="$(echo "$CUTTLEFISH_OUTPUT" | tail -1 \ + | sed -e $'s/-config/\\\nconfig=/g' \ + | sed -e $'s/-args_file/\\\nargs_file=/g' \ + | sed -e $'s/-vm_args/\\\nvm_args=/g')" CONFIG_FILE="$(trim "$(echo -e "$lines" | grep 'config=' | sed 's/config=//g')")" CUTTLE_GEN_ARG_FILE="$(trim "$(echo -e "$lines" | grep 'vm_args=' | sed 's/vm_args=//g')")"