xref: /freebsd/usr.bin/less/lesspipe.sh (revision d0b2dbfa0ecf2bbc9709efc5e20baf8e4b44bbbf)
1f07cfbf5SDavid E. O'Brien#! /bin/sh
2f07cfbf5SDavid E. O'Brien# ex:ts=8
3f07cfbf5SDavid E. O'Brien
4f07cfbf5SDavid E. O'Briencase "$1" in
52852a34fSAlex Kozlov	*.zip)
62852a34fSAlex Kozlov		exec unzip -c "$1" 2>/dev/null
72852a34fSAlex Kozlov		;;
840d28fe1SDag-Erling Smørgrav	*.Z)
946a3ae64SLukas Ertl		exec uncompress -c "$1"	2>/dev/null
10f07cfbf5SDavid E. O'Brien		;;
1140d28fe1SDag-Erling Smørgrav	*.gz)
1246a3ae64SLukas Ertl		exec gzip -d -c "$1"	2>/dev/null
13f07cfbf5SDavid E. O'Brien		;;
1440d28fe1SDag-Erling Smørgrav	*.bz2)
1546a3ae64SLukas Ertl		exec bzip2 -d -c "$1"	2>/dev/null
1640d28fe1SDag-Erling Smørgrav		;;
1781ad8388SMartin Matuska	*.xz)
1881ad8388SMartin Matuska		exec xz -d -c "$1"	2>/dev/null
1981ad8388SMartin Matuska		;;
2081ad8388SMartin Matuska	*.lzma)
2181ad8388SMartin Matuska		exec lzma -d -c "$1"	2>/dev/null
2281ad8388SMartin Matuska		;;
237ccae4e0SBaptiste Daroussin	*.zst)
247ccae4e0SBaptiste Daroussin		exec zstd -d -q -c "$1"	2>/dev/null
257ccae4e0SBaptiste Daroussin		;;
26*e6ffcf4aSFernando Apesteguía	*)	exec cat "$1"		2>/dev/null
27*e6ffcf4aSFernando Apesteguía		;;
28f07cfbf5SDavid E. O'Brienesac
29