我尝试在线搜索答案,但答案(如果存在)被 shell 脚本中的其他 dot 应用程序所掩盖。所以就到这里了。
编辑:原来它与 Fedora 的默认配置有关command_not_found_handle
,所以它与 bash 源代码无关。/编辑
我发现虽然 bash 通常会抱怨缺少命令,甚至我在命令行中输入的任何内容都是一个目录:
[root@localhost tmp] # mkdir test
[root@localhost tmp] # test
[root@localhost tmp] # nonexistent
bash: nonexistent: command not found...
[root@localhost tmp] # test
[root@localhost tmp] # cd test
[root@localhost test] # empty
bash: empty: command not found...
[root@localhost test] # .
bash: .: filename argument required
.: usage: . filename [arguments]
[root@localhost test] # ..
Run Code Online (Sandbox Code Playgroud)
以上内容显然是有效且符合预期的。但这些:
[root@localhost test] # ....
[root@localhost test] # ......................... …
Run Code Online (Sandbox Code Playgroud)