From e4017e610685a8466aa4fc7ed122e4800585d052 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 6 Mar 2012 22:25:39 +0100 Subject: [PATCH] feature #1112: Move SED initialization to scripts_common.sh. Always fix path for SRC/DST --- src/mad/sh/scripts_common.sh | 6 ++++++ src/tm_mad/tm_common.sh | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index 365a6a410e..307c5cf618 100755 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -38,6 +38,12 @@ SUDO=sudo WGET=wget GREP=grep +if [ "x$(uname -s)" = "xLinux" ]; then + SED="$SED -r" +else + SED="/usr/bin/sed -E" +fi + # Used for log messages SCRIPT_NAME=`basename $0` diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index 4c8c721ba9..b189b12f33 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -33,12 +33,6 @@ ONE_SH=$ONE_LIB/sh . $ONE_SH/scripts_common.sh -if [ "x$(uname -s)" = "xLinux" ]; then - SED="$SED -r" -else - SED="/usr/bin/sed -E" -fi - # ------------------------------------------------------------------------------ # Function to get hosts and paths from arguments # ------------------------------------------------------------------------------ @@ -52,7 +46,8 @@ function arg_host # Gets the path from an argument function arg_path { - echo $1 | $SED 's/^[^:]*:(.*)$/\1/' + ARG_PATH=`echo $1 | $SED 's/^[^:]*:(.*)$/\1/'` + fix_dir_slashes "$ARG_PATH" } #Return the DATASTORE_LOCATION from OpenNebula configuration