CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
openssl: updated to 1.0.2o
[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" ;;
a709ac08
VM
16 *.tar.xz|*.tar.lzma) tar tJvvf "$1" ;;
17 *.xz|*.lzma) xz -dc "$1" ;;
6dca1d21
JB
18 *.[zZ]|*.gz) gzip -dc "$1" ;;
19 *.bz2) bzip2 -dc "$1" ;;
20 *.zip) zipinfo "$1" ;;
21 *.cpio) cpio -itv < "$1" ;;
22 esac
23}
24
25filter "$1" 2> /dev/null
26
27# End of file