/etc/csh.cshrc is not extensible (like csh.login).
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
tcsh (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The "csh.login" file checks for extensions in /etc/csh/login.d . By adding:
set dir=/etc/
if (-e $dir && `/bin/ls $dir` != "") then
foreach FILE (`/bin/ls $dir/*`)
source $FILE;
end;
endif
unset dir
to /etc/csh.cshrc I now have the same feature for csh.cshrc. This means that by putting my "csh.aliases" file in the proper directory I now have my aliases available in a "sudo -s" shell too.
I got bored typing out the directory name three times, and it's bad software engineering to have the same string there three times. I set the variable and then use the variable three times.
I personally thing that the foreach line should read:
foreach FILE ($dir/*)
which would work for files containing spaces whereas the code above executes an unneccessary external program and fails should there be files with spaces in the directory.
I also think that the "if" should be:
if (-d $dir .... )
to test for a directory.
But.... Either someone incompetent at shell programming wrote this, or there are reasons I don't understand.
For minimal invasiveness: use the code snippet near the top.....
irrelevant details:
Description: Ubuntu 14.04 LTS
Release: 14.04
(I've been anoyed at this for quite a while now, only now got around to fixing/reporting it. I'd say: fix in 14.10).