Red Hat Bugzilla – Bug 186931
less breaks with tcsh's printexitvalue=1
Last modified: 2010-10-20 07:26:59 EDT
1. Create a new user with the tcsh shell as the default
useradd test1 -s /bin/tcsh
2. Set the printexitvalue as a default
echo "set printexitvalue=1" > ~test1/.cshrc
3. Login as test1
su - test1
4. Try to see with less a file that doesn't have a handler in lesspipe.sh
$ less /etc/hosts
This is due to lesspipe.sh trying to launch "--" as the viewer command
($DECOMPRESSOR isn't set)
Attached patch fixes that
Created attachment 126827 [details]
This is not specific to tcsh's printexitvalue=1.
This bug happens if the tcsh's startup scripts create any output.
1. Create /etc/profile.d/test.csh that contains:
2. Login as a user with tcsh as the default shell
3. Run: less /etc/hosts
Results: You see the word "FOO" displayed rather than the text of /etc/hosts
Cause: less does a popen("/bin/tcsh -c /usr/bin/lesspipe.sh /etc/hosts") where
the shell is gotten from the users default shell.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.