Hacker News new | ask | show | jobs
by zokier 3034 days ago
> If /usr/bin is on a case-insensitive filesystem, and you execvp("CD", ...)

That seems like fairly rare edge case, considering that UNIX typically had case-sensitive file-systems, or rather handled filenames as opaque blobs. I wonder what actual system caused the need for case folding? Maybe HFS?

1 comments

The `tr` bit isn't actually in the FreeBSD version of the script[1], so I'm assuming it's a macOS HFS thing.

https://github.com/freebsd/freebsd/blob/master/usr.bin/alias...

Mac filesystems case-fold by default, so the script could be invoked as cd, CD, Cd, or CD. Only the lowercase cd is shadowed by the builtin.