- D_=`dirname "$relpath_"`
- B_=`basename "$relpath_"`
- abspath_=`cd "$D_" 2>/dev/null && pwd || echo "$D_"`/$B_
- end_path_=`echo "$abspath_" |tr --squeeze-repeats /`
- dprint "relToAbs(): \"$relpath_\" => \"$end_path_\""
- echo "$end_path_"
+ abspath_="`readlink -f \"$relpath_\"`" || \
+ warn "relToAbs(): Problems getting absolute path" "$?" || return 1
+ dprint "relToAbs(): \"$relpath_\" => \"$abspath_\""
+ echo "$abspath_"
+}
+
+
+# Trim off white-space characters
+# white-space in the "C" and "POSIX" locales are:
+# space
+# form-feed ('\f')
+# newline ('\n')
+# carriage return ('\r')
+# horizontal tab ('\t')
+# vertical tab ('\v')
+stringTrim()
+{
+ local str_="$1"
+ local result_=""
+
+ result_="`echo "$str_" | sed -e 's/^\s*//' -e 's/\s*$//'`" || \
+ warn "stringTrim(): Problems stripping of blanks" || return 1
+ dprint "stringTrim(): \"$str_\" => \"$result_\""
+ echo "$result_"