In this example, the goal for the re-invocation is increase the thread count over and above the default 40 threads.
As can be seen, the steps are as follows:
1. write some code that detects that re-invocation is necessary -- see the if statement
2. Recompute the command line as a string with each parameter value surrounded by single quotes. See the for statement
3. execute brash with the new options and use the -c option to pass the command line
4. exit or return with same error code, see $?, as brash exited with.
Note that only exported variables will be passed to the child instance of brash. Arrays will not be exported.
Last edit: Lowell Boggs, Jr. 2016-08-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's an example of re-invoking brash.exe with different command line options from within a brash script:
In this example, the goal for the re-invocation is increase the thread count over and above the default 40 threads.
As can be seen, the steps are as follows:
1. write some code that detects that re-invocation is necessary -- see the if statement
2. Recompute the command line as a string with each parameter value surrounded by single quotes. See the for statement
3. execute brash with the new options and use the -c option to pass the command line
4. exit or return with same error code, see $?, as brash exited with.
Note that only exported variables will be passed to the child instance of brash. Arrays will not be exported.
Last edit: Lowell Boggs, Jr. 2016-08-13