macos – Can Bash case-insensitive matching for executables in $PATH be disabled?

[ad_1]

No it can’t!

If you happen to test it with ls -ldi /usr/bin/grep /usr/bin/Grep you’ll
see that each exist in your filesystem however they’re the identical inode. Humorous element is that in truth the filesystem shops a case delicate string, solely one of many 16 mixtures of GREP writing ( trick to see it: cd /usr/bin ; echo [gG][rR][eE][pP] ). Some individuals speak of case preserving FS however it’s only a approach to improve confusion.

This isn’t a bash typical downside. Any shell will present you an identical reality.
This can be a filesystem “characteristic”¹.
This kind of floating naming of information results in supply codes which may
create a file named “A” and in a while open it as “a”, thus creating bugs, vulnerabilities and crapwares.

The way in which to eliminate this downside, is:

  1. make an entire backup copy of the
    root filesystem on an exterior disk formatted as a “case-sensitive” one.
    A superb device for this activity is Carbon Copy Cloner ( you’ll be able to obtain
    the identical good copy with rsync however with an arm lengthy checklist of
    arguments ).
  2. Reboot on this exterior backup.
  3. Reformat the unique root filesystem as a “case-sensitive” one.
  4. Make the symmetric copy out of your exterior disk towards your unique one.

( Examined and utilized on many variations of macOS since > 20 years ).


¹)  Temporary historical past of filesystems: case insensitive filesystems
    have been created to assist individuals who may expertise issues
    with the usage of uppercase.
    Since greater than ½ century all Unix OS are working on
    case delicate filesystems.
    These days, most filesystems are much more open to the usage of
    quite a few alphabets, with many extra variations than simply
    decrease case versus higher case and implement appropriately UTF-8
    ( https://en.wikipedia.org/wiki/UTF-8 ).

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *