On Fri, Jun 21, 2002 at 01:22:09AM +0100, Brian Foster wrote:
> I'm writing a wrapper shell script around less(1) for various
> bizarre reasons that are not particularly relevant, and in the
probably won't be helpful in your case, but less has several useful
environment variables. the less man page has a very useful explaination
of the LESSOPEN environment var. it's quite possible to configure less
to page through a lot of things in a handy way. my lessopen script
works like so:
LESSOPEN="|~/bin/lessopen.sh %s"
#! /bin/sh
case "$1" in
*.tar)
tar tvf "$1" 2>/dev/null
;;
*.tar.gz)
tar ztvf "$1" 2>/dev/null
;;
*.Z|*.gz)
zcat "$1" 2>/dev/null
;;
*.bz2)
bzcat "$1" 2>/dev/null
;;
*.rpm)
rpm -qilp "$1" 2>/dev/null
;;
esac
essentially, less is like the emacs of pagers.
kevin
--
kevin at suberic.net that a believer is happier than a skeptic is no more to
fork()'ed on 37058400 the point than the fact that a drunken man is happier
meatspace place: inle than a sober one. the happiness of credulity is a
http://suberic.net/~kevin cheap & dangerous quality -- g.b. shaw
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!