Page MenuHomeFreeBSD

zless(1): handle uncompressed files
ClosedPublic

Authored by fernape on Feb 19 2023, 5:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 31, 12:58 PM
Unknown Object (File)
Tue, Mar 31, 12:11 AM
Unknown Object (File)
Thu, Mar 26, 3:22 AM
Unknown Object (File)
Thu, Mar 26, 2:31 AM
Unknown Object (File)
Mon, Mar 23, 4:46 PM
Unknown Object (File)
Mon, Mar 23, 1:18 AM
Unknown Object (File)
Sun, Mar 22, 12:27 PM
Unknown Object (File)
Fri, Mar 20, 6:58 AM
Subscribers

Details

Summary

In the manual page for zmore(1) and zless(1) it is said that zless(1) is
equivalent to zmore(1) except that it uses less(1) as a pager. However
zmore(1) is able to handle uncompressed files transparently while zless(1)
is not.

Add another case to the switch in lesspipe.sh to handle non-compressed files.

PR: 196437
Reported by: marquis@roble.com

Test Plan

Before the patch:

$ echo "Hello world!" > test
$ gzip test
$ zmore test.gz
Hello world!
$ zless test.gz
<shows file>
$ zmore test
Hello world!
$ zless test








test (END)

After the patch, zless test shows the file normally. This also is in sync with
the manual page.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable