summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2016-02-15 22:42:01 -0800
committerMichael Klishin <michael@clojurewerkz.org>2016-02-15 22:42:01 -0800
commit7f1a82c9640a573d309881fc59453eab96fbd4e2 (patch)
tree0b3df7f9f5604cff3209dd5a8beef84249dae305 /scripts
parent897458190d41596f2aa4d513172b6e6dd66aadb9 (diff)
parent99c982d3cf0e2b2b89ae1253ec52c16b02d4161e (diff)
downloadrabbitmq-server-git-7f1a82c9640a573d309881fc59453eab96fbd4e2.tar.gz
Merge branch 'cbandy-posix-sed'
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rabbitmq-env8
-rw-r--r--scripts/rabbitmq-script-wrapper7
2 files changed, 3 insertions, 12 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index 872e5492de..2a0d48085b 100644
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -103,15 +103,11 @@ 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 $SED_OPT -e 's,//+,/,g' -e 's,(.)/$,\1,'
+ # Remove redundant slashes and strip a trailing slash
+ echo "$path" | sed -e 's#/\{2,\}#/#g' -e 's#/$##'
}
rmq_normalize_path_var() {
diff --git a/scripts/rabbitmq-script-wrapper b/scripts/rabbitmq-script-wrapper
index ed4c276e53..9623f01709 100644
--- a/scripts/rabbitmq-script-wrapper
+++ b/scripts/rabbitmq-script-wrapper
@@ -15,14 +15,9 @@
## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
##
-SED_OPT="-E"
-if [ $(uname -s) = "Linux" ]; then
- SED_OPT="-r"
-fi
-
for arg in "$@" ; do
# Wrap each arg in single quotes and wrap single quotes in double quotes, so that they're passed through cleanly.
- arg=`printf %s "$arg" | sed $SED_OPT -e "s/'/'\"'\"'/g"`
+ arg=`printf %s "$arg" | sed -e "s#'#'\"'\"'#g"`
CMDLINE="${CMDLINE} '${arg}'"
done