lesspipe.sh is an input filter for the pager less as described in less's man page. The script runs under a ksh-compatible shell (ksh, bash, zsh) and allows you to use less to view files with binary content, compressed files, archives, and files contained in archives.
Viewing files by accessing a device file is implemented to some extent (DOS filesystems and tar files). It supports many formats (both as plain and compressed files using compress, gzip, bzip2, or zip). Syntax highlighting for many languages is available through a helper script, "code2color".
Product's homepage
What's New in This Release: [ read full changelog ]
· detect proper options for the file command at runtime (Vincent Lefèvre)
· guess the character encoding and optionally do a char conversion (VL)
· make colored ls output working for different OS flavours (Marc Abramowitz)
· do not interpret files with an extension .xml as html files (James Ahlborn)
· eval `.../lesspipe.sh` will set LESS_ADVANCED_PREPROCESSOR if meaningful
· sample less wrapper to open URLs with less (in contrib) (Sebastian Kayser) Version 1.71 Apr 06 2010
· detect a good version of tar, try to avoid /usr/bin/tar on Solaris (Jim Pryor)
· do more preprocessing if LESS_ADVANCED_PREPROCESSOR is set
· always try to interpret (g)roff formatted text (man pages)
· better detection of lzip and xz compressed files (Vincent Lefèvre)
· do not call identify for 'image text' tagged files (Vincent Lefèvre)
· do not rely on contents of LANG variable for calling iconv (Vincent Lefèvre)
· have a fallback to bash or zsh for the shell used at runtime (Vincent Lefèvre) Version 1.70 Jul 16 2009
· fixing the call of mktemp on MacOS (reported by Peter Kostka and Martin Otte)
· detect helper programs at runtime (suggested by David Leverton, Petr Uzel)
· add support for xz compression (Mathieu Bouillaguet)
· more stringent tests for gzip compression
· changes in rpm processing to better support MacOSX and BSD based systems
· introduce --fixed in configure to statically control lesspipe generation
· improved generation of Makefile
· calling eval `.../lesspipe.sh` will set the ENV variable LESSOPEN properly
· fixing jar processing if not using fastjar (was a bug in 1.60 only)
· control amount of preprocessing by the ENV var LESS_ADVANCED_PREPROCESSOR if the related configure question is answered with y (default n) (Petr Uzel)
· updated documentation to reflect recent changes Version 1.60 Dec 01, 2008
· major restructuring of code, support for even more file types (Jim Pryor)
· using a temp dir and mktemp for creating temporary files
· concentrate file type recognition in a function
· rewritten the recognition and processing of html files, added xhtml recognition, add elinks and w3m as html parsers
· better support for jar files (recognized by extension jar and xpi)
· support for excel and powerpoint files (recognized by extension)
· support for perl pod files
· colored directory listings
· list and view the control parts of *.deb packages
· added support for lzip compression (Antonio Diaz Diaz)
· added support for DjVu files (Florian Cramer)
· improved zip support for Solaris, bug fixes in configure (Paul Townsend)
· code cleanup and bug fixes in lesspipe based on the restructured code
· enhanced test suite
· update of the documentation (merged english.txt and README) Version 1.55 Aug 13, 2008
· cleanup documentation and code
· remove support for unmounted media (floppy disks)
· better UTF-8 support, add conversions between UTF-8 and ISO-8859-1
· add preliminary support for lzma compressed files (suggested by Goetz Waschk)
· better support for 7-zip files (suggestion by Stephan Hegel)
· fix misspelled program name 'links' Version 1.54 Jul 25, 2008
· improved support for mp3 files using id3v2 (hint from Markus Meyer)
· added tests for mp3 files with id3 v1 and v2 tags
· correctly recognize version of file command
· prefer links over lynx for html display
· add support for binary plist files (Mac OS X) (Peter D. Barnes Jr.)
· add support for gpg encrypted files (Daniel Risacher) Version 1.53 Apr 11, 2006
· support for Openoffice documents (Florian Cramer, Vincent Lefevre)
· support for RAR archives (suggested by Cindy Leonhardt)
· support for 7-zip archives, UTF-16 text (proposed by Vincent Lefevre)
· support for image formats (png, gif, jpeg and others)
· small shell syntax fix (reported by Andrew Barnert)
· better test to recognize tar and dvi files
· do not include the full path for commands if they are in the search PATH
· avoid "file -" command, relax requirements for "file", Solaris now ok (Ken)
· display debian files without dpkg (hint by Juergen Kahnert)
· mention in BUGS that syntax highlighting is an experimental feature
· require at least version 1.0 of bzip2
· updated documentation Version 1.52 Jul 19, 2005
· variable replacement pattern containing % causes hang in AIX, escape % char
· the output of the file command can contain file names, make it harder to mislead the file type recognition logic Version 1.51 May 26, 2005
· fix typo in Makefile (PREFIX instead of prefix in configure)
· change consistently test syntax to be compliant to more shells
· display command to set LESSOPEN env variable when called without args
· fix a few cases where filenames containing space were not treated properly
· add a manpage for lesspipe.sh Version 1.50 Apr 12, 2005
· major changes in the processing of file names, thus allowing the display of files with white space in the name even if they are contained in archives
· display of "perl storable" (see perldoc Storable) files by Slaven Rezic
· many changes to get rid of minor bugs related to syntax highlighting and the display of files contained in archives
· lesspipe.sh successfully tested to also work with pdksh (tested with v. 5.2)
· added test suite, commands listed in TESTCMDS, test files are in testok and testnok. Can be started with make test
· improved configure script and documentation enhancements