From b330cd1311500f3896ee701c4dea27e9160a8c9b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 21 Nov 2009 23:21:55 +0100 Subject: Use [[ -n $command[...] ]] instead of which .. &> /dev/null --- etc/env | 4 ++-- etc/rc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/env b/etc/env index 9a94ed5..3072302 100644 --- a/etc/env +++ b/etc/env @@ -16,10 +16,10 @@ export LESS='--silent --no-init --clear-screen --RAW-CONTROL-CHARS --quit-if-one export HOST export COLUMNS export LINES -if which lesspipe &> /dev/null; then +if [[ -n $commands[lesspipe] ]] { export LESSOPEN='| lesspipe %s' export LESSCLOSE='lesspipe %s %s' -fi +} # local settings, not tracked with git [[ -r $ZDIR/local-env ]] && source $ZDIR/local-env diff --git a/etc/rc b/etc/rc index c34fe26..dbad048 100644 --- a/etc/rc +++ b/etc/rc @@ -100,7 +100,7 @@ export MAKEFLAGS=j$(grep -c '^processor' /proc/cpuinfo) [[ $path[1] = $HOME/bin ]] || export PATH=$HOME/bin:$PATH # Add manuals from caretaker to manpath -which manpath &> /dev/null && [[ -z $MANPATH ]] && export MANPATH=$(manpath):$HOME/packages/.collected/man +[[ -n $commands[manpath] && -z $MANPATH ]] && export MANPATH=$(manpath):$HOME/packages/.collected/man # }}} # {{{ MIME parameters -- cgit v1.2.3