请您提供有关 zsh 文档这一部分的见解。我在这个文档上花了很长时间,但机器人可以说清楚:http: //zsh.sourceforge.net/Doc/Release/Shell-Grammar.html#Alternate-Forms-For-Complex-Commands
我正在寻找所有命令的清晰示例if
for
foreach
while
until
repeat
case
select
function
。
为什么看似zsh
明白要做什么some_variable=1 command
,却又不明白some-variable=1 command
?例如:$ fs_screen=1 mpv --fs-screen=${fs_screen} someFile.mp4
工作正常,但$ fs-screen=1 mpv --fs-screen=${fs-screen} someFile.mp4
结果是zsh: command not found: fs-screen=1
我深入研究了 zsh 文档,发现了我认为的问题所在。摘自https://zsh.sourceforge.io/Doc/Release/Shell-Grammar.html#Precommand-Modifiers:
\nA simple command may be preceded by a precommand modifier, which will alter how the command is interpreted. These modifiers are shell builtin commands with the exception of nocorrect which is a reserved word.\n\n-\nThe command is executed with a \xe2\x80\x98-\xe2\x80\x99 prepended to its argv[0] string.\n
Run Code Online (Sandbox Code Playgroud)\n但是,我在任何地方都找不到有关此内容的更多信息。它的目的是什么,是否可以禁用它,以便我可以使用 …