...
Table plus |
---|
...
...
|
...
|
...
|
...
...
|
...
| ||||||||
|
Description
Excerpt | ||
---|---|---|
| ||
Executes the command of the operating system. |
</ac:rich-text-body>
</ac:structured-macro>
<p>Executes Executes the command of the operating system. Returns the exit code of the program and the output and error streams as strings. Through this you may integrate outside scripts (sh, ksh, perl,...) with Jira. Streams are limited to 4Kb (only the first 4Kb are taken into account).</p></p>
<h2>Parameters</h2>
<ac:structured-macro ac:name="table-plus" ac:schema-version="1">
<ac:parameter ac:name="applyColStyleToCell">true</ac:parameter>
<ac:parameter ac:name="columnTypes">s
Parameters
Table plus | ||||
---|---|---|---|---|
|
...
| ||||||||
|
Return Type
String []
The routine returns an array with 3 elements in such order:</p><ol> <li>The
The operating system exit code of the process being spawned (as string)
...
The output stream (limited to 4Kb) as a
...
string
The error stream (limited to 4Kb) as a
...
string
Examples
Let's create a file using system routine and windows command prompt:</p> <ac:structured-macro ac:name="
Code Block |
---|
...
...
string testfolder="c:/tests"; //assuming that folder 'tests' has been already created in c:\ path |
...
system("C:/WINDOWS/system32/cmd.exe /c echo return true;> " + testfolder + "qqq.sil"); // you can run here any other program or custom script |
...
Let's invoke a windows.bat script file using system routine:</p> <ac:structured-macro ac:name="
Code Block |
---|
...
...
string testfolder="c: /tests /"; //assuming this path exists. //we assume in this path a file called `myexec.bat` has been previously created and contains one line `echo Hello;` |
...
//now the following call will return `0.0|[THE_PATH_OF_EXECUTION]>echo Hello; Hello;|` return system ("C:/WINDOWS/system32/cmd.exe /c " + testfolder + "myexec.bat" ); |
...
</ac:structured-macro><h2>Note</h2>
<p><ac:structured-macro ac:name="
Note |
---|
<ac:rich-text-body>
<p>For
For windows operating system, you should put the full (absolute) path of the command. |
</ac:rich-text-body>
</ac:structured-macro></p><h2>See also</h2>
<p><ac:structured-macro ac:name="contentbylabel" ac:schema-version="4">
<ac:parameter ac:name="showLabels">false</ac:parameter>
<ac:parameter ac:name="max">25</ac:parameter>
<ac:parameter ac:name="showSpace">false</ac:parameter>
<ac:parameter ac:name="cql">label = "system_routines
See also
Filter by label (Content by label) | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
...
|