Red Hat Bugzilla – Bug 101019
Scripts named "test" when "." is in $path before /usr/bin recursively call themselves
Last modified: 2007-04-18 12:56:14 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Description of problem:
tcsh scripts named "test" will recursively call themselves when dot (".") is in
$path before /usr/bin. Example:
set path=(. $path)
then run in tcsh:
Be ready to pkill "test" or you will jam your system.
Version-Release number of selected component (if applicable):
With RedHat 9
Steps to Reproduce:
1.Run example code in Description
Actual Results: The script recursively calls itself and jams the system.
Expected Results: The script should have returned "." and the value of $path.
It would appear the tcsh is using the system "test" command when doing "echo"
but uses the user defined $path to find it.
No, (test) is used in /etc/profile.d/colorls.csh, which
is sourced from /etc/csh.cshrc.
If you modify $path so that standard POSIX commands don't work,
you can't expect to have a sane environment. Many programs
would likewise fail if you have a custom script called "ls".