Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This routine is available starting with katl-commons 1.0.

Not available on cloud.
Info
titleAvailability
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

system(command)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Executes the command of the operating system.

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).

Parameters

Parameter name

Type

Required

Description

command

string

String

yes

Yes

Valid Operating System command.

...

Return Type

string String []

The routine returns an array with 3 elements in such order:

  1. The operating system exit code of the process being spawned (as string)
  2. The output stream (limited to 4Kb) as a string
  3. The error stream (limited to 4Kb) as a string

...

returnNote

Examples

Let's create a file using system routine and windows command prompt:

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:

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" );

Note

Note

For windows operating system, you should put the full (absolute) path of the command.

Info

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "system_routines" and space = currentSpace ( )
labelsarray_routines
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

system(command)

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
Executes the command of the operating system.

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).

Parameters

Parameter name

Type

Required

Description

command

String

Yes

Valid Operating System command.

Return Type

String []

returnNote

Examples

Let's create a file using system routine and windows command prompt:

title
Code Block
Creating a file using command promt
string testfolder="c:/tests"; //assuming that folerfolder `tests`'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:

Invoking a windows .bat file
Code Block
title
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" );

Note

Note

For windows operating system, you should put the full (absolute) path of the command.

Info

See also

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "system_routines" and space = currentSpace ( )
labelssystemarray_routines