summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2003-03-06 04:35:48 +0000
committerobrien <obrien@FreeBSD.org>2003-03-06 04:35:48 +0000
commit1d6788bfb79e60b1f5e19a600aa922df603c38ad (patch)
treeda36906761f2878473335f47493be98bcaf469d6 /usr.bin
parentc50367da676eaa300253058b5594f783a3db948b (diff)
downloadFreeBSD-src-1d6788bfb79e60b1f5e19a600aa922df603c38ad.zip
FreeBSD-src-1d6788bfb79e60b1f5e19a600aa922df603c38ad.tar.gz
Add an embellished lesspipe.sh as described in the man page.
P.S. it is stupid I have to define both SCRIPTS and SCRIPTSNAME.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/less/Makefile2
-rw-r--r--usr.bin/less/lesspipe.sh13
2 files changed, 15 insertions, 0 deletions
diff --git a/usr.bin/less/Makefile b/usr.bin/less/Makefile
index d9dd968..22b03bf 100644
--- a/usr.bin/less/Makefile
+++ b/usr.bin/less/Makefile
@@ -5,6 +5,8 @@ SRCS= main.c screen.c brac.c ch.c charset.c cmdbuf.c command.c decode.c \
edit.c filename.c forwback.c help.c ifile.c input.c jump.c line.c \
linenum.c lsystem.c mark.c optfunc.c option.c opttbl.c os.c output.c \
position.c prompt.c search.c signal.c tags.c ttyin.c version.c
+SCRIPTS=lesspipe.sh
+SCRIPTSNAME=lesspipe.sh
DPADD= ${LIBTERMCAP}
LDADD= -ltermcap
LINKS= ${BINDIR}/less ${BINDIR}/more
diff --git a/usr.bin/less/lesspipe.sh b/usr.bin/less/lesspipe.sh
new file mode 100644
index 0000000..2cef2c5
--- /dev/null
+++ b/usr.bin/less/lesspipe.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+# ex:ts=8
+
+# $FreeBSD$
+
+case "$1" in
+ *.Z) uncompress -c $1 2>/dev/null
+ ;;
+ *.gz) gzip -d -c $1 2>/dev/null
+ ;;
+ *.bz2) bzip2 -d -c $1 2>/dev/null
+ ;;
+esac
OpenPOWER on IntegriCloud