简体   繁体   English

osx bash 强制区分大小写

[英]osx bash force case sensitivity

Me:~ me$ cd desktop
Me:desktop me$ pwd
/Users/me/desktop

What is the correct way to force case sensitivity (so that cd desktop fails but cd Desktop goes to the correct directory)?强制区分大小写的正确方法是什么(以便cd desktop失败但cd Desktop进入正确的目录)? I would assume there was a shopt for that but the manpage doesn't suggest any obvious option.我会假设有一个shopt ,但手册页没有建议任何明显的选择。

听起来有问题的文件系统不区分大小写-请参阅此处的第一个答案以进行验证。

Case-sensitivity is an option of the file system, not of the shell.区分大小写是文件系统的选项,而不是 shell 的选项。 Therefore you cannot change this with a shell option.因此,您不能使用 shell 选项更改它。

(To understand why, just consider that it is possible to have case-sensitive and case-insensitive filesystems mounted at the same time. How would you handle this with a single shell option?) (要理解为什么,只需考虑可能同时安装区分大小写和不区分大小写的文件系统。您将如何使用单个 shell 选项来处理这个问题?)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM