Bug 196437

Summary: zless doesn't correctly display uncompressed files
Product: Base System Reporter: marquis
Component: binAssignee: freebsd-bugs mailing list <bugs>
Status: New ---    
Severity: Affects Many People    
Priority: ---    
Version: 9.3-RELEASE   
Hardware: Any   
OS: Any   

Description marquis 2015-01-02 13:47:25 UTC
The current FreeBSD /usr/bin/zless:

 export LESSOPEN="||/usr/bin/lesspipe.sh %s"
 exec /usr/bin/less "$@"

displays a blank page when attempting to read a file that is not compressed.  GNU versions:

 if test "${LESSMETACHARS+set}" != set; then
   # Work around a bug in less 394 and earlier;
   # it mishandles the metacharacters '$%=~'.
   space=' '
   tab=' '
   newline='
 '
   LESSMETACHARS="$space$tab$newline'"';*?"()<>[|&^`#\$%=~'
   export LESSMETACHARS
 fi
 LESSOPEN="|-gzip -cdfq -- %s"; export LESSOPEN
 exec less "$@"

work as expected.