CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
make: fixed build and updated release
[crossrootfs.git] / less / filter
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
8 filter() {
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 *.tar.xz|*.tar.lzma) tar tJvvf "$1" ;;
17 *.xz|*.lzma) xz -dc "$1" ;;
18 *.[zZ]|*.gz) gzip -dc "$1" ;;
19 *.bz2) bzip2 -dc "$1" ;;
20 *.zip) zipinfo "$1" ;;
21 *.cpio) cpio -itv < "$1" ;;
22 esac
23 }
24
25 filter "$1" 2> /dev/null
26
27 # End of file