Description of problem: When using the redhat less rpm's /usr/bin/lesspipe.sh, you can reference DECOMPRESSOR when it is unassigned. This happens when viewing a normal file that is not a .gz or .bz2 file (see the * case in lesspipe.sh). Normally this fails silently and less takes the empty output to mean that it should use its default behavior and open the file itself, but if using csh and you have 'printexitvalue' set, the shell will output 'Exit 127' when it tries to execute -- (the first thing after the reference to the undefined DECOMPRESSOR). less sees this output from lesspipe.sh and assumes lesspipe.sh has done the proper processing. So all the user sees when he calls less is the 'Exit 127' (the output from 'csh -c /usr/bin/lesspipe.sh ...') and not the file he wanted to view (whatever it may be). This could be fixed a number of ways... - don't set printexitvalue if not in an interactive shell. - have less only use stdout from lesspipe.sh (it may already do that) and have csh print the exit value to stderr But lesspipe.sh should really not try to use an unassigned variable. The fix is easy. See attached patch. Version-Release number of selected component (if applicable): less-394 rpm (and probably earlier versions as well). How reproducible: Every time. Steps to Reproduce: 1. echo set printexitvalue > /tmp/.cshrc 2. env -i SHELL=/bin/csh HOME=/tmp LESSOPEN="|/usr/bin/lesspipe.sh %s" TERM=xterm less /tmp/.cshrc Actual results: 'Exit 127' /tmp/.cshrc (END) Expected results: set printexitvalue /tmp/.cshrc (END) Additional info:
Created attachment 128571 [details] patch to lesspipe.sh to keep from referencing undef DECOMPRESSOR
Thanks. This problem is fixed in less-394-4.
*** Bug 191308 has been marked as a duplicate of this bug. ***