{DESY Logo}

Get lesspipe.sh, a preprocessor for less at SourceForge.net. Fast, secure and Free Open Source software downloads

freshmeat.net

Index
about me

UNIX Refguide
UNIX tools
Perl
HEPiX


Download
lesspipe.tar.gz(HTTP)
lesspipe.tar.gz(FTP)


Displaying more with less

lesspipe.sh is an input filter for the pager less as described in its man page. The script runs under a ksh compliant shell (ksh, bash, zsh) and allows to view files with binary content, compressed files, archives and files contained in archives. A large and growing number of formats are supported both as plain and compressed files using compress, gzip, bzip2, lzma, lzip or zip.
Details can be found in the README file.

Experimental support for syntax highlighting was added through a perl script code2color which is derived from Peter Palfraders code2html script. The script code2color is written in perl and has colorizing support for the languages ada, asm, awk, c, c++, groff, html, xml, java, javascript, lisp, m4, make, pascal, patch, perl, povray, python, ruby, shellscript and sql.

Syntax highlighting is only activated if the environment variable LESS is existing and contains the option -R or -r or less is called with one of these options. This guarantees, that instead of literal escape sequences colors are displayed. The detection of the -r/-R presence at runtime is rather dependent on the operating system and may not work in all cases.

The script lesspipe.sh needs a lot of helper programs that may or may not be installed on your computer. Therefore you should download the tarball lesspipe.tar.gz and use configure to customize lesspipe.sh for the local computer. A preconfigured lesspipe.sh for Linux assuming that all helper programs are installed is provided as an example only. There syntax highlighting is switched off. The code2color script that does the colorization is used only, if lesspipe.sh is regenerated appropriately using configure.

To get support for newer file types an additional magic file (for use in the file command, e.g. in ~/.magic) might have to be created. In that case the environment variable MAGIC has to be set and has to contain both the system magic file and your personal one. Example:
MAGIC='/usr/share/file/magic:/Users/myaccount/.magic'
export MAGIC

Download

The tarball lesspipe.tar.gz is available here.

The following files are available separately for download (all contained in the tarball):

If you prefer FTP for download then click here.
Older versions can be downloaded from the FTP archive as well.

Documentation

Here is an incomplete list of articles that do describe lesspipe.sh

Linux Magazin 01/2001
CERN Computing Newsletter 01/2002
Linux User 04/2002 (in german)
Linux Magazine 21/2002

The latest version (Dec 01, 2008) is 1.60

This document is maintained by .