在 dart:io 库中,为什么要在调用 Process.run 时设置 runInShell: true?

In the dart:io library, why would one want to set runInShell: true when calling Process.run?

这提供了什么功能?此外,当 runInShell 设置为 false 时如何调用进程?有什么区别?

您可以使用 your_executable 或 runInShell 创建一个新的子进程,使用 shell 可执行文件创建一个新的子进程并传递 -c your_executable 来制作shell 使用 your_executable 创建一个新的子进程。 例如,如果你想执行 bash 内置函数,或者如果你想为具有特定 .bashrc 的新进程创建一个新环境,或者如果你有一个带有 hashbang 的脚本并且想要 shell 弄清楚如何 运行 该可执行文件。