From b539f87ad6f4f7a4875d774ae208bb60f4bfe642 Mon Sep 17 00:00:00 2001 From: Viktor Jancik Date: Sat, 22 Aug 2015 00:45:30 +0200 Subject: [PATCH] Modification to previous profile.d script changes --- less.csh | 7 ++++--- less.sh | 9 ++------- less.zsh | 10 ++-------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/less.csh b/less.csh index c3dae53..d58763d 100755 --- a/less.csh +++ b/less.csh @@ -1,8 +1,9 @@ +#!/bin/csh # less initialization script (csh) if ( -x /usr/bin/lesspipe.sh ) then - if ( $?LESSOPEN && { eval 'test ! -z $LESSOPEN' }) then - setenv LESSOPEN "$LESSOPEN | /usr/bin/lesspipe.sh %s" + if ( $?LESSOPEN && { eval 'test ! -z $LESSOPEN' } ) then + : else - setenv LESSOPEN "/usr/bin/lesspipe.sh %s" + setenv LESSOPEN "|/usr/bin/lesspipe.sh %s" endif endif diff --git a/less.sh b/less.sh index c8066ec..eeade55 100755 --- a/less.sh +++ b/less.sh @@ -1,9 +1,4 @@ -#!/bin/sh # less initialization script (sh) -if [ -x /usr/bin/lesspipe.sh ]; then - if [ -z "$LESSOPEN" ]; then - export LESSOPEN="/usr/bin/lesspipe.sh %s" - else - export LESSOPEN="$LESSOPEN | /usr/bin/lesspipe.sh %s" - fi +if [ -x /usr/bin/lesspipe.sh ] && [ -z $LESSOPEN ]; then + export LESSOPEN="|/usr/bin/lesspipe.sh %s" fi diff --git a/less.zsh b/less.zsh index 7949583..b5d4175 100755 --- a/less.zsh +++ b/less.zsh @@ -1,11 +1,5 @@ #!/bin/zsh # less initialization script (sh) -if [[ -x /usr/bin/lesspipe.sh ]] ; then - if [[ -z "$LESSOPEN" ]] ; then - export LESSOPEN="/usr/bin/lesspipe.sh %s" - else - export LESSOPEN="$LESSOPEN | /usr/bin/lesspipe.sh %s" - fi +if [[ -x /usr/bin/lesspipe.sh && -z "$LESSOPEN" ]] ; then + export LESSOPEN="|/usr/bin/lesspipe.sh %s" fi - -echo $LESSOPEN