# Hopefully one of these is installed (no flamewars about preference please!):
for editor in $VISUAL $EDITOR nano vim vi emacs pico qe mg jed gedit mc-edit; do
- if which $editor > /dev/null 2>&1; then
+ if command -v $editor > /dev/null 2>&1; then
exec $editor "$@"
fi
done
# We don't use 'more' because it will exit if the file is too short.
# Worst case scenario we'll open the file in your editor.
for pager in $PAGER less most w3m i3-sensible-editor; do
- if which $pager > /dev/null 2>&1; then
+ if command -v $pager > /dev/null 2>&1; then
exec $pager "$@"
fi
done
# distribution-specific mechanism to find the preferred terminal emulator. On
# Debian, there is the x-terminal-emulator symlink for example.
for terminal in $TERMINAL urxvt rxvt terminator Eterm aterm xterm gnome-terminal roxterm xfce4-terminal; do
- if which $terminal > /dev/null 2>&1; then
+ if command -v $terminal > /dev/null 2>&1; then
exec $terminal "$@"
fi
done