Process
Last updated
Was this helpful?
Last updated
Was this helpful?
Operators and functions for working with processes and applications are described here. The Args and ArgCount functions work with any command line format. For the correct operation of other Arg... functions, the command line must have the following format.
Operator
Result
Description
$ command line
Executes the command line.
str = $ command line
Executes the command line and returns its output.
The Arg function returns the value of the parameter with the specified name. If the parameter was not specified at the start of the script, an empty string will be returned. You can omit the initial character - in the name parameter.
The Arg function returns the value of the parameter with the specified name. If the parameter was not specified at the start of the script, def will be returned. You can omit the initial character - in the name parameter.
The Arg function returns the numeric value of the parameter with the specified name. If the parameter was not specified at the start of the script, def will be returned. You can omit the initial character - in the name parameter.
The ArgCount function returns the number of command line parameters with which the script was run.
The Args function returns a list of all command-line parameters and options with which the script has been run.
The Args function returns a list of parameter values named name. You can omit the initial character - in the name parameter.
The ArgsTail function returns the list of command line parameters after the options. You can explicitly specify the beginning of such parameters with -.
The IsArg function returns true if the command line has an option with the specified name. Otherwise, it returns false. You can omit the initial character - in the name parameter.
The Open function opens a file, directory, or URI using the OS's default application for that object type. Don't wait for the open command to complete.
The OpenWith function opens a file, directory, or URI using the specified application. Don't wait for the open command to complete.
Optional parameters
buf stdin - the buffer that will be passed to the application as standard input.
buf stdout - the buffer into which the standard output of the application will be written.
buf stderr - the buffer into which the standard error output of the application will be written.
The Run function starts the specified cmd program with parameters and waits for it to finish. Additionally, you can override the standard input and output.
The SplitCmdLine function parses the input string with command line parameters and returns an array of parameters.
Optional parameters
buf stdin - the buffer that will be passed to the application as standard input.
The Start function starts the specified program cmd with parameters and runs the script further. Additionally, you can pass the buffer as standard input.