1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

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
This commit is contained in:
Dag-Erling Smørgrav 2005-05-17 11:14:11 +00:00
parent 40d28fe140
commit 2430592ce1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=146314
2 changed files with 11 additions and 3 deletions

View File

@ -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

7
usr.bin/less/zless.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
#
# $FreeBSD$
#
export LESSOPEN="|/usr/bin/lesspipe.sh %s"
exec /usr/bin/less "$@"