+++ This bug was initially created as a clone of Bug #202468 +++ Description of problem: This was initially raised by Jack Neely (jjneely, see bz #186931, comment #3) and verified to be present in RHEL 4.4 Version-Release number of selected component (if applicable): less-382-4.rhel4.i386 How reproducible: always Steps to Reproduce: 1.Create /etc/profile.d/test.csh that contains: --- #!/bin/tcsh echo "FOO" --- 2.Login as a user with tcsh as the default shell 3.Run: less /etc/hosts Actual results: You see the word "FOO" displayed rather than the text of /etc/hosts Expected results: the text of /etc/hosts Additional info: less does a popen("/bin/tcsh -c /usr/bin/lesspipe.sh /etc/hosts") where the shell is gotten from the users default shell. I've verified this bug exists in RHEL 5 with less-394-5.el5
This is caused by a processing of scripts /etc/profile.d/* in non-interactive mod of tcsh. When tcsh is executed, then all scripts in /etc/profile.d/*.csh are executed too. Even in non-interactive mod. But in this mod, tcsh should not execute those scripts. This bad behavior leads to problems, because a less is confused. Then the less accepts as a input a text from echo instead a text from /etc/hosts. The solution is to reflect non-interactive mod in /etc/csh.cshrc. I'll attach a patch, which solve this. Zdenek
Created attachment 265931 [details] patch to fix non-interactive mod of tcsh
Thanks, including fix in next rawhide package. Read ya, Phil