to hang forever. Reported by Rasmus Steinke.
* zshrc: Fix problems related to TERM=mostlike in zshrc. Again reported by
Rasmus Steinke.
+ * zshrc: Give check_com a -g option to test for global aliases, too.
[ Michael Prokop ]
* zshrc: add deborphan, pal and hnb to compdef _gnu_generic. Thanks for
the suggestion to Carsten Hey.
- -- Michael Prokop <mika@grml.org> Fri, 05 Jun 2009 09:35:58 +0200
+ -- Frank Terbeck <ft@grml.org> Sun, 07 Jun 2009 12:55:15 +0200
grml-etc-core (0.3.72) unstable; urgency=low
# this function checks if a command exists and returns either true
# or false. This avoids using 'which' and 'whence', which will
# avoid problems with aliases for which on certain weird systems. :-)
+# Usage: check_com [-c|-g] word
+# -c only checks for external commands
+# -g does the usual tests and also checks for global aliases
check_com() {
- local -i comonly
+ local -i comonly gatoo
if [[ ${1} == '-c' ]] ; then
(( comonly = 1 ))
shift
+ elif [[ ${1} == '-g' ]] ; then
+ (( gatoo = 1 ))
else
(( comonly = 0 ))
+ (( gatoo = 0 ))
fi
if (( ${#argv} != 1 )) ; then
return 0
fi
+ if (( gatoo > 0 )) && [[ -n ${galiases[$1]} ]] ; then
+ return 0
+ fi
+
return 1
}