summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2016-02-01 01:08:50 +0300
committerMichael Klishin <michael@clojurewerkz.org>2016-02-01 01:08:50 +0300
commit0aced26f965fd53a5dc34adfde48e36f9276b053 (patch)
tree349f95e9cab02ad7ad51c5a42802b0ddd5eca629 /scripts
parent4f7da6bef9f9b273c9749739275b1a12ab3be91c (diff)
downloadrabbitmq-server-git-0aced26f965fd53a5dc34adfde48e36f9276b053.tar.gz
Use -r with sed on Linux, fixes #592
We previously did the same change in #273 (PR: #275), but the file in which it was done was removed in 231e90cacf3daec5f43b3307867129e61496b123. Note that #592 recommends using `-r` unconditionally but that option is not recognised by sed which ships with OS X.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rabbitmq-env7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index 0014643260..4c1d0c9da2 100644
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -103,10 +103,15 @@ fi
##--- Set environment vars RABBITMQ_<var_name> to defaults if not set
+SED_OPT="-E"
+if [ $(uname -s) = "Linux" ]; then
+ SED_OPT="-r"
+fi
+
rmq_normalize_path() {
local path=$1
- echo "$path" | sed -E -e 's,//+,/,g' -e 's,(.)/$,\1,'
+ echo "$path" | sed $SED_OPT -e 's,//+,/,g' -e 's,(.)/$,\1,'
}
rmq_normalize_path_var() {