Up: Component summary Component

BashEvaluate

Executes a Bash script that generates any output from the given data or other inputs.

Arbitrary outputs can be redirected into files optOut1, optOut2, and optOut3. You can write any files in the binary folder output ports folder1, folder2 and folder3. An array output can be written in array1 output.

Version 1.4.2
Bundle tools
Categories External
Specialties generic
Authors Ville Rantanen (ville.rantanen@helsinki.fi)
Issue tracker View/Report issues
Requires bash ; csvkit (python)
Source files component.xml evaluate.bash
Usage Example with default values

Type parameters (generics)

Inputs

Name Type Mandatory Description
array1 Array<INarray1> (generic) Optional Generic input that may be used for arrays. Use getarraykeys array1 and getarrayfiles array1 to read the contents
array2 Array<INarray2> (generic) Optional Generic input that may be used for arrays. Use getarraykeys array2 and getarrayfiles array2 to read the contents
array3 Array<INarray3> (generic) Optional Generic input that may be used for arrays. Use getarraykeys array3 and getarrayfiles array3 to read the contents
command BashSource Optional Bash script to read.
var1 INa (generic) Optional Generic input that may be used for folders and binaries. @var1@ will be replaced as the string location of the input
var2 INb (generic) Optional Generic input that may be used for folders and binaries. @var2@ will be replaced as the string location of the input
var3 INc (generic) Optional Generic input that may be used for folders and binaries. @var3@ will be replaced as the string location of the input
var4 INd (generic) Optional Generic input that may be used for folders and binaries. @var4@ will be replaced as the string location of the input
var5 INe (generic) Optional Generic input that may be used for folders and binaries. @var5@ will be replaced as the string location of the input
var6 INf (generic) Optional Generic input that may be used for folders and binaries. @var6@ will be replaced as the string location of the input
vararray Array<INarray4> (generic) Optional Keys from vararray will be mapped to variables in bash scope with the corresponding string value. So "key1" will become "$key1" in bash. The keys here will overwrite any other values and currently must be valid bash variable names as this is not checked, or they may be accessed with getarraykeys vararray and getarrayfiles vararray.

Outputs

Name Type Description
scriptOut BashSource The given script after being replaced with input and parameter contents.
stdOut BinaryFile Any output from the script
stdErr BinaryFile Any error output from the script
out1 OUTa (generic) An optional output that can be used for custom data types. By default this file is empty. If you need a folder, remove the empty file first. @out1@ is replaced as the location of this file (or folder).
out2 OUTb (generic) An optional output that can be used for custom data types. By default this file is empty. @out2@ is replaced as the location of this file.
out3 OUTc (generic) An optional output that can be used for custom data types. By default this file is empty. @out3@ is replaced as the location of this file.
folder1 BinaryFolder An optional output folder that can be used for custom folder data types. By default this folder is empty. @folder1@ is replaced as the location of this folder.
folder2 BinaryFolder An optional output folder that can be used for custom folder data types. By default this folder is empty. @folder2@ is replaced as the location of this folder.
folder3 BinaryFolder An optional output folder that can be used for custom folder data types. By default this folder is empty. @folder3@ is replaced as the location of this folder.
arrayOut1 Array<Ta> (generic) An optional output array that can be used for custom data types. By default this array is empty. Use keyword @arrayIndex1@ to refer to the index file and @arrayOut1@ to refer to the array folder.
arrayOut2 Array<Tb> (generic) See output array1.
arrayOut3 Array<Tc> (generic) See output array1.

Parameters

Name Type Default Description
echoStdOut boolean false Redirect stdOut also to the console.
failOnErr boolean true Fails the component if the script encounters errors.
param1 string "" Value of this parameter will be assigned to @param1@ string
param2 string "" Value of this parameter will be assigned to @param2@ string
param3 string "" Value of this parameter will be assigned to @param3@ string
param4 string "" Value of this parameter will be assigned to @param4@ string
param5 string "" Value of this parameter will be assigned to @param5@ string
script string "" Value of this parameter will override the script input.

Test cases

Test case Parameters IN
array1
IN
array2
IN
array3
IN
command
IN
var1
IN
var2
IN
var3
IN
var4
IN
var5
IN
var6
IN
vararray
OUT
scriptOut
OUT
stdOut
OUT
stdErr
OUT
out1
OUT
out2
OUT
out3
OUT
folder1
OUT
folder2
OUT
folder3
OUT
arrayOut1
OUT
arrayOut2
OUT
arrayOut3
case1_read_var_write_stdout properties (missing) (missing) (missing) command var1 var2 (missing) (missing) (missing) (missing) (missing) (missing) stdOut stdErr out1 out2 out3 folder1 folder2 folder3 arrayOut1 (missing) (missing)

failOnErr=false

case2_write_optout1 properties (missing) (missing) (missing) (missing) var1 (missing) (missing) (missing) (missing) (missing) (missing) (missing) stdOut stdErr out1 out2 out3 folder1 folder2 folder3 arrayOut1 (missing) (missing)

script=echo Header > @out1@ ; ls -1 @var1@ >> @out1@

case3_forloop_and_folder1 properties (missing) (missing) (missing) command var1 (missing) (missing) (missing) (missing) (missing) (missing) (missing) stdOut stdErr out1 out2 out3 folder1 folder2 folder3 arrayOut1 (missing) (missing)

param1=fox

case4_produce_error properties (missing) (missing) (missing) (missing) (missing) (missing) (missing) (missing) (missing) (missing) (missing) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure) (expecting failure)

script = command_not_found_PHcZmD4rN4

case5_array_in properties array1 (missing) (missing) command (missing) (missing) (missing) (missing) (missing) (missing) (missing) (missing) stdOut stdErr out1 out2 out3 folder1 folder2 folder3 arrayOut1 (missing) (missing)

param1=b

case7_comma_sep_param properties (missing) (missing) (missing) command (missing) (missing) (missing) (missing) (missing) (missing) (missing) (missing) stdOut (missing) out1 out2 out3 folder1 folder2 folder3 arrayOut1 (missing) (missing)

failOnErr=false,
param1=oink,moo,meow,woof,
param2=key=1,foo=bar


Generated 2018-12-17 07:42:27 by Anduril 2.0.0