Re: lessecho missing?



Steve M. Fabac, Jr. typed (on Fri, Mar 30, 2007 at 03:55:35AM +0000):
| Jeff Hyman wrote:
| >
| >Any environmental variables needing to be exported, that are not?
| ># set | grep -y less
| >LESS=-ceij4z-4
| >LESSOPEN='|lesspipe %s'
| >
| >- Jeff H
|
| On my 5.0.7 system:
|
| $ set | grep -y less
| LESS='--chop-long-lines --shift 8'
|
| What is the function of LESSOPEN above?

Invokes a pre-filtering script, which I happen to call 'lesspipe', which
enables less to show you a compressed file. (the man page's description
is more better :-)

#!/bin/sh
#@(#) lesspipe; JPRadley; 17Nov99 v 1.0; 29Mar07 v 1.1
#@(#) invoked by 'less' when the env.var. LESSOPEN='|lesspipe %s'

case "$1" in
*.gz|*.tgz|*.Z) zcat $1 2>/dev/null ;;
*.bz2) bzcat $1 2>/dev/null ;;
esac

--
JP
==> http://www.frappr.com/cusm <==
.