Skip to content
Snippets Groups Projects
Commit 601596b2 authored by Karl-Hermann Wieners's avatar Karl-Hermann Wieners
Browse files

mkexp: fixed bash shell utility 'cdexp' to handle absolute file names

parent 1a70708e
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,8 @@ Global
* Improved retrieval of working directory for 'update' script,
using 'PWD' from environment if available
* Fixed bash shell utility 'cdexp' to handle absolute file names
when reading from 'update' script
Release 1.0.2
=============
......
......@@ -30,13 +30,14 @@ cdexp () {
cfg="$1"
elif [[ -f update ]]
then
eval $(awk '/^cd / {dir=$2; print "dir=" dir ";"}; /^exec / {print "cfg=" dir "/" $3}' update)
eval $(awk '/^cd / {dir=$2; print "dir=" dir ";"}; /^exec / {print "cfg=" $3}' update)
else
echo 'Oops: invalid number of parameters' >&2
return 1
fi
var=${var^^};
var=${var%_DIR};
[[ $cfg != /* ]] && cfg=$dir/$cfg
var=${var^^}
var=${var%_DIR}
vardir=$(builtin cd "$dir" && getexp -k "${var}_DIR" "$cfg") &&
cd "$vardir"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment