Avoid some have() calls.

Single file existence etc checks are cheaper than full $PATH lookups.
This commit is contained in:
Ville Skyttä 2011-04-04 22:12:40 +03:00
parent c65949385a
commit f7c93600a6
3 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@
# Test for existence of /etc/profile.d/modules.sh too because we may end up
# being sourced before it and thus before the `module' alias has been defined.
have module || [ -f /etc/profile.d/modules.sh ] && {
[ -f /etc/profile.d/modules.sh ] || have module && {
_module_list ()
{

View File

@ -1,6 +1,6 @@
# bash completion for Slackware Linux pkgtools
have removepkg && [ -f /etc/slackware-version ] &&
[ -f /etc/slackware-version ] && have removepkg &&
_removepkg()
{
local packages cur

View File

@ -4,7 +4,7 @@
# 'service' command and/or the SysV init.d directory, followed by
# that script's available commands
#
{ have service || [ -d /etc/init.d/ ]; } &&
[ -d /etc/init.d ] || have service &&
_service()
{
local cur prev sysvdir