1
0
mirror of https://github.com/limosek/zaf.git synced 2024-11-23 10:59:06 +01:00

Internal which now search in more dirs

This commit is contained in:
Lukas Macura 2016-11-21 17:11:30 +01:00
parent b80fd5ce7f
commit 72ef383146
2 changed files with 6 additions and 4 deletions

View File

@ -21,8 +21,9 @@ zaf_which() {
if which >/dev/null 2>/dev/null; then
which "$1"
else
[ -x /bin/$1 ] && { echo /bin/$1; return; }
[ -x /usr/bin/$1 ] && { echo /usr/bin/$1; return; }
for i in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin; do
[ -x $i/$1 ] && { echo $i/$1; return; }
done
return 1
fi
}

View File

@ -24,8 +24,9 @@ zaf_which() {
if which >/dev/null 2>/dev/null; then
which "$1"
else
[ -x /bin/$1 ] && { echo /bin/$1; return; }
[ -x /usr/bin/$1 ] && { echo /usr/bin/$1; return; }
for i in /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin; do
[ -x $i/$1 ] && { echo $i/$1; return; }
done
return 1
fi
}