Revision 9051
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
123 | 123 |
echo "$path" |
124 | 124 |
} |
125 | 125 |
|
126 |
# makes $1 a canon_rel_path if it's a filesystem path |
|
127 |
alias cmd2rel_path="$(cat <<'EOF' |
|
128 |
if test "$(type -t "$1")" = file && test -e "$1"; then # not relative to PATH |
|
129 |
declare _1="$1"; shift |
|
130 |
set -- "$(canon_rel_path "$_1")" "$@" |
|
131 |
fi |
|
132 |
EOF |
|
133 |
)" |
|
126 | 134 |
|
135 |
|
|
127 | 136 |
#### verbose output |
128 | 137 |
|
129 | 138 |
# usage: (stdout2stderr; cmd...) || return |
Also available in: Unified diff
lib/sh/util.sh: added cmd2rel_path alias, which makes $1 a canon_rel_path if it's a filesystem path. this removes extra .. in the paths of invoked commands.