From f446d4cae9daf2e9b275caffca9f020196a0dd82 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Mon, 13 May 2019 16:42:27 +0200 Subject: [PATCH] libstd.bash: fixes in append_path() and prepend_path() - use export instead of eval --- Pmodules/libstd.bash | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Pmodules/libstd.bash b/Pmodules/libstd.bash index ad7f0e6..846484d 100644 --- a/Pmodules/libstd.bash +++ b/Pmodules/libstd.bash @@ -67,14 +67,14 @@ std::get_abspath() { } std::append_path () { - local -r P="$1" - local -r d="$2" + local -r P=$1 + local -r d=$2 if ! echo ${!P} | egrep -q "(^|:)${d}($|:)" ; then if [[ -z ${!P} ]]; then - eval $P=\"${d}\" + export "$P=${d}" else - eval $P=\"${!P}:${d}\" + export "$P=${!P}:${d}" fi fi } @@ -85,9 +85,9 @@ std::prepend_path () { if ! echo ${!P} | egrep -q "(^|:)${d}($|:)" ; then if [[ -z ${!P} ]]; then - eval $P=${d} + export "$P=${d}" else - eval $P=${d}:${!P} + export "$P=${d}:${!P}" fi fi }