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

mkexp: make cdexp shell function robust against dir variables containing _DIR

parent ba865658
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,8 @@ cdexp () {
echo 'Oops: invalid number of parameters' >&2
return 1
fi
vardir=$(getexp -p "$dir" -k "${var^^}_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