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

282 views Asked by At

What functionality does this offer? Furthermore, how does the process get called when runInShell is set to false? What's the difference?

1

There are 1 answers

2
Günter Zöchbauer On BEST ANSWER

You can just create a new child process with your_executable or alternatively with runInShell, create a new child process with the shell executable and pass -c your_executable to make the shell create a new child process with your_executable. For example if you want to execute bash builtins or if you want to create a new environment for the new process with a specific .bashrc or if you have a script with a hashbang and want to shell figure out how to run that executable.