Hi Vadim,
Vadim Zhukov wrote on Sat, May 03, 2014 at 05:44:26PM +0400:
> Just run into the following issue with zmore/zless:
> if you have PAGER envvar set, it's no matter whatever
> you'll call, zmore or zless - it'll always run $PAGER.
> The problem is that I have PAGER=/usr/bin/more but
> sometimes I want to use less. If I run "less foo",
> I get what I requested; if I run "zless foo", I got
> what zless thinks it knows better of.
I agree that violates the principle of least surprise.
> Sure, I can add alias for zmore/zless but is there
> any point in using PAGER in those scripts at all?
> Why not to just call "less" for "zless" and "more"
> in other cases?
OK schwarze@, but you also need the following chunk.
Yours,
Ingo
--- zmore.1 16 Aug 2009 09:41:08 -0000 1.10
+++ zmore.1 7 May 2014 18:58:44 -0000
@@ -47,11 +47,11 @@ and
formats are supported).
Any
.Ar flags
-that are specified are passed to the user's preferred
-.Ev PAGER
-(which is
-.Pa /usr/bin/more
-by default).
+that are specified are passed to
+.Xr more 1
+or
+.Xr less 1 ,
+respectively.
.Pp
.Nm zless
is equivalent to
> Index: zmore
> ===================================================================
> RCS file: /cvs/src/usr.bin/compress/zmore,v
> retrieving revision 1.6
> diff -u -p -r1.6 zmore
> --- zmore 20 Aug 2008 09:22:02 -0000 1.6
> +++ zmore 3 May 2014 13:43:16 -0000
> @@ -40,9 +40,9 @@ while test $# -ne 0; do
> done
>
> if [ `basename $0` == "zless" ] ; then
> - pager=${PAGER-less}
> + pager=less
> else
> - pager=${PAGER-more}
> + pager=more
> fi
>
> # No files means read from stdin
> Index: zmore.1
> ===================================================================
> RCS file: /cvs/src/usr.bin/compress/zmore.1,v
> retrieving revision 1.10
> diff -u -p -r1.10 zmore.1
> --- zmore.1 16 Aug 2009 09:41:08 -0000 1.10
> +++ zmore.1 3 May 2014 13:43:16 -0000
> @@ -90,18 +90,6 @@ In this mode
> will assume
> .Xr gzip 1
> style compression since there is no suffix on which to make a decision.
> -.Sh ENVIRONMENT
> -.Bl -tag -width "PAGER"
> -.It Ev PAGER
> -Program used to display files.
> -If unset,
> -.Pa /usr/bin/more
> -is used
> -.Pq Nm zmore
> -or
> -.Pa /usr/bin/less
> -.Pq Nm zless .
> -.El
> .Sh SEE ALSO
> .Xr compress 1 ,
> .Xr gzip 1 ,