diff options
author | des <des@FreeBSD.org> | 2005-05-17 11:14:11 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2005-05-17 11:14:11 +0000 |
commit | b51b7d4a0ff5db4f5a95c50c6e5bb3c596e8f7eb (patch) | |
tree | 8a64dc3746e8a3f3244825fa74a18d7e8f5e5606 /usr.bin | |
parent | 46223419456929a3ab47cf69c209afb19dbbf4ce (diff) | |
download | FreeBSD-src-b51b7d4a0ff5db4f5a95c50c6e5bb3c596e8f7eb.zip FreeBSD-src-b51b7d4a0ff5db4f5a95c50c6e5bb3c596e8f7eb.tar.gz |
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
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/less/Makefile | 7 | ||||
-rw-r--r-- | usr.bin/less/zless.sh | 7 |
2 files changed, 11 insertions, 3 deletions
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 "$@" |