diff --git a/lib/bourne-shell.sh b/lib/bourne-shell.sh index 03ecc56..634b0a6 100644 --- a/lib/bourne-shell.sh +++ b/lib/bourne-shell.sh @@ -3,7 +3,17 @@ # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" +if [ -z "${LESSOPEN}" ];then + if [ -f /etc/gentoo-release ]; then + export LESSOPEN="|lesspipe %s" + else + if [ -x /usr/bin/lesspipe ]; then + eval "$(SHELL=/bin/sh /usr/bin/lesspipe)" + elif [ -x /usr/bin/lesspipe.sh ]; then + eval "$(SHELL=/bin/sh /usr/bin/lesspipe.sh)" + fi + fi +fi # set variable identifying the chroot you work in (used in the prompt below) if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then