CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
signify: initial import
[crossrootfs.git] / less / filter
CommitLineData
6dca1d21
JB
1#!/bin/sh
2#
3# /usr/lib/less/filter: less(1) filter
4#
5# To use: export LESSOPEN="|/usr/lib/less/filter %s"
6#
7
8filter() {
9 case "$1" in
10 *.[1-9n]) cat "$1" | nroff -c -mandoc | cat -s ;;
11 *.[1-9n].gz) zcat "$1" | nroff -c -mandoc | cat -s ;;
12 *.[1-9n].bz2) bzcat "$1" | nroff -c -mandoc | cat -s ;;
13 *.tar) tar tvvf "$1" ;;
14 *.tgz|*.tar.gz|*.tar.[zZ]) tar tzvvf "$1" ;;
15 *.tbz2|*.tar.bz2) tar tjvvf "$1" ;;
16 *.[zZ]|*.gz) gzip -dc "$1" ;;
17 *.bz2) bzip2 -dc "$1" ;;
18 *.zip) zipinfo "$1" ;;
19 *.cpio) cpio -itv < "$1" ;;
20 esac
21}
22
23filter "$1" 2> /dev/null
24
25# End of file