From b51b7d4a0ff5db4f5a95c50c6e5bb3c596e8f7eb Mon Sep 17 00:00:00 2001 From: des Date: Tue, 17 May 2005 11:14:11 +0000 Subject: Add a zless script which invokes less using the lesspipe script. This is similar to the zmore script that comes with gzip (and in fact, in most Linux distros, zless is a symlink to that very same zmore script) but has the advantage that you get the correct file name on the less status line, and can use :n and :p to navigate back and forth between multiple files. MFC after: 1 week --- usr.bin/less/Makefile | 7 ++++--- usr.bin/less/zless.sh | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 usr.bin/less/zless.sh (limited to 'usr.bin/less') diff --git a/usr.bin/less/Makefile b/usr.bin/less/Makefile index 22b03bf..541a7a8 100644 --- a/usr.bin/less/Makefile +++ b/usr.bin/less/Makefile @@ -5,11 +5,12 @@ 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 +SCRIPTS=lesspipe.sh zless +SCRIPTSNAME_lesspipe.sh=lesspipe.sh DPADD= ${LIBTERMCAP} LDADD= -ltermcap -LINKS= ${BINDIR}/less ${BINDIR}/more +LINKS= ${BINDIR}/less ${BINDIR}/more \ + ${BINDIR}/zless ${BINDIR}/bzless MLINKS= less.1 more.1 CLEANFILES= less.1 diff --git a/usr.bin/less/zless.sh b/usr.bin/less/zless.sh new file mode 100644 index 0000000..b947b81 --- /dev/null +++ b/usr.bin/less/zless.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +export LESSOPEN="|/usr/bin/lesspipe.sh %s" +exec /usr/bin/less "$@" -- cgit v1.1