tcsh weird behaviour

Stephen James

Registered

I'd installed a Perl module which clobbered my /usr/bin/head as it had installed a
/usr/bin/HEAD

So investigated and found that the shell tcsh ignores case for filenames. This may or may not be configurable but the behavour is weird.

[localhost:/tmp] root# sh -x weird
+ rm -f /usr/bin/head /usr/bin/HEAD
+ touch /usr/bin/head /usr/bin/HEAD
+ ls -l /usr/bin/head /usr/bin/HEAD
-rw-r--r-- 1 root wheel 0 May 15 22:30 /usr/bin/HEAD
-rw-r--r-- 1 root wheel 0 May 15 22:30 /usr/bin/head
+ cp /etc/group /usr/bin/HEAD
+ ls -l /usr/bin/head /usr/bin/HEAD
-rw-r--r-- 1 root wheel 555 May 15 22:30 /usr/bin/HEAD
-rw-r--r-- 1 root wheel 555 May 15 22:30 /usr/bin/head
+ rm /usr/bin/HEAD
+ ls -l /usr/bin/head /usr/bin/HEAD
ls: /usr/bin/HEAD: No such file or directory
ls: /usr/bin/head: No such file or directory
[localhost:/tmp] root#

Notice how /usr/bin/head becomes the same /usr/bin/HEAD, I can't believe this is correct as it would go against the basic casesensitive Unix way.

So my /usr/bin/head was clobbered now where do I get my original back from, where is it on the CD.


Should tcsh behave like this?.
 
Actually, that's the way HFS+ (and HFS) work; they are case insensitive, but case preserving, so HEAD will overwrite head but using 'head' will call 'HEAD'...
This is one of the few places where UFS is the better filesystem to use.
 
So how do I get around this.

I didn't realise this HFS+ did this, I can't actually see the use of it messing with the case and all.

A bit like WinNT going off and removing case when you create a folder PERL it says Perl.

No if I meant Perl I would have typed Perl.

OK so I guess I messed up when I installed MacosX, I should of chosen UFS. Although it would seem to me that HFS breaks the Unix case rules so shouldn't be offered, as a choice.

What options have I got.

I also need to recover a version of /usr/bin/head where can I get it from. Is it somewhere on the CDs.?

regards.
 
Same exact thing happened to me. It was the perl LWP bundle that did it. And I wasn't able to find it on the CD. If you email me, I can send you the binary. Remove the x's to email: xgene02@xsmalltime.xcom
 
You didn't mess up when choosing HFS+. OS X is horribly slow when using UFS. You could say POSIX messed up when choosing case sensitivity (or rather were too lazy to figure it out)

HFS+ will preserve case, it will merely disallow two files being in the same location if their only difference is case. So if you type Perl it will be Perl, not PERL.

 
Back
Top