Problems with csh

Mark Waterhouse mark at dfk-systems.com
Wed Jul 12 16:09:21 UTC 2006


Hi all

A user on our campus has discovered a small bug within csh that I would like 
to share with the community; predominately to confirm if this is a bug and, 
if it, to see what you all think.

My user is trying to capture the exit status of csh when running against a 
certain internal script.
For the sake of completeness, I've created a very small script which does 
nothing but echo a string.

The script, called 'test', looks like this;
[sysadmin at ns02 ~]$ cat test
echo $status
echo DFK
echo $status

On each machine that I tested this on (Centos/FC3/FC1), I get an output of 
"1".
On the FreeBSD, Solaris and SuSE boxes, I get the correct output.

Do you think this is a bug?
fwiw, I noticed that on the Centos/FCx/RHEL boxes, /bin/csh is symlinked to 
/bin/tcsh. Ah....except that the same is true for SuSE.

Any ideas greatly appreciated.

Thanks
Mark



Centos 3.6
[sysadmin at ns02 sysadmin]$ csh
[sysadmin at ns02 ~]$ csh -e test
[sysadmin at ns02 ~]$ echo $status
1

Fedora Core 3
[root at webhost ~]$ csh
[root at webhost ~]$ csh -e test
[root at webhost ~]$ echo $status
1

Fedora Core 1
[mark at secure mark]$ csh
[mark at secure ~]# csh -e test
[mark at secure ~]# echo $status
1

FreeBSD 5.4-STABLE
> csh
%csh -e test
0
DFK
0
%echo $status
0

Solaris 2.6 (5.6)
# csh
noo-noo# csh -e test
0
DFK
0
noo-noo# echo $status
0

SuSE Enterprise Server 9 (x86_64)
octopus % 24 : csh
octopus % 21 : csh -e test
0
DFK
0
octopus % 22 : echo $status
0 



-- 
This message has been scanned for viruses and dangerous content by DFK Systems Limited, and is believed to be clean.
To report this message as spam, please click on this link - https://secure.dfk-systems.com/quarantine/spam.php?id=k6CG9rRJ084385




More information about the redhat-sysadmin-list mailing list