[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [lesspipe]



I really like using a .lesskey file to set up a .less binary
configuration file.  Then you'll have the configuration no matter what
the environment is when you start less.  Here is my .lesskey:


# $Header: /users/bradshaw/RCS/.lesskey,v 1.1 1996/09/21 01:25:38 bradshaw Exp bradshaw $

#env
LESS     = -is
LESSOPEN = |~/.lesspipe.sh %s


The less manpage also shows separate lessopen and lessclose scripts, but
using the pipe above seems to avoid the need for any of the cleanup
provided by lessclose.

Install the file by running "lesskey".  This will create a binary
.less file.  You'll also need something to put in the ~/.lesspipe.sh.
Since you aren't at hamm yet, you might want to try my .lesspipe.sh.
Unfortunately it doesn't handle all the file types mentioned in a
previous message, but you should be able to extend it.  This works for
bash and tcsh, but I haven't tried anything else.


#! /bin/sh

# $Header: /users/bradshaw/bin/RCS/lesspipe.sh,v 1.1 1996/09/21 01:32:37 bradshaw Exp bradshaw $

case "$1" in

	# view compressed files correctly
	*.Z|*.z|*.gz) gzip -dc $1 2>/dev/null;;
	*.zip) unzip -l $1 2>/dev/null ;;

	# view contents of .tar and .tgz
	*.tar)
		 tar tvvf $1 2>/dev/null ;;
	*.tgz|*.tar.gz|*.tar.Z|*.tar.z)
		 tar tzvvf $1 2>/dev/null ;;

	# groff source
	*.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.man) FILE=`file -L $1` ;
		FILE=`echo $FILE | cut -d ' ' -f 2`
		if [ "$FILE" = "troff" ]; then
			groff -s -p -t -e -Tascii -mandoc $1
		fi ;;

esac


> Remco Blaakmeer wrote:
> 
> > To configure "less" to be more useful, you can set some environment
> > variables. If you like them, place the commands to set them in
> > /etc/profile and they will be set every time you log in. These are the
> > commands:
> > 
> > export LESSOPEN='|/usr/bin/lesspipe %s'
> > 	This makes "less" pipe everything you view through this script.
> > This gives you readable information for verious non-text files, like
> > .tgz,
> > .gz, .tar, .zip, .arj and .deb files.
> 
> This is nice, but where is lesspipe?
> 
> $ more /var/lib/dpkg/info/less.list
> /.
> /usr
> /usr/doc
> /usr/doc/less
> /usr/doc/less/changelog.Debian.gz
> /usr/doc/less/copyright
> /usr/doc/less/NEWS.gz
> /usr/doc/less/README.gz
> /usr/bin
> /usr/bin/less
> /usr/bin/lesskey
> /usr/man
> /usr/man/man1
> /usr/man/man1/less.1.gz
> /usr/man/man1/lesskey.1.gz
> 
> Not there!
> 
> Thanks!
> -- 
> Peter Galbraith, research scientist

-- 
Lee Bradshaw                 lee.bradshaw@mindspring.com (preferred)
Next Level Communications    bradshaw@nlc.com

-- 
Lee Bradshaw                 lee.bradshaw@mindspring.com (preferred)
Next Level Communications    bradshaw@nlc.com


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: