shell property

  1. @Deprecated('use start(runInShell: true)')
void shell

shell Runs the given string as a command in the OS shell.

Allows you to execute the contents of a dart string as a command line application within an OS shell (e.g. bash). The application is run as a fully attached child process.

DCli performs Glob expansion on command arguments. See run for details.

Any output from the command is displayed on the console.

'zip regions.txt regions.zip'.shell;

If you need to pass an argument to your application that contains spaces then use nested quotes: e.g.

'wc "fred nurk.text"'.shell;

DCli performs Glob expansion on command arguments. See run for details.

See forEach to capture output to stdout and stderr toList to capture stdout and stderr to List<String> toParagraph to concatenating the return lines into a single string. firstLine - returns just the first line written to stdout. lastLine - returns just the last line written to stdout or stderr. parser - returns a parser with the captured output ready to be interpreted as one of several file types.

Implementation

@Deprecated('use start(runInShell: true)')
void get shell => cmd.run(this, runInShell: true);