I have a simple shell script in job (I insert this script in pentaho element shell script) like
Code:
#!/bin/sh
set -x


line="1 2 3"
ar=( $line )
echo "${#ar[@]}"
I try to change first string to #!/usr/bin/env bash also. But I did not receive the result of this script. When I executed in ubuntu terminal, I received result "3". And if I put file with this script in pentaho element, it's also work. But I need to use it like script which was inserted directly in pentaho element.

Without command set -x, the script run successfully and job ends. But with this command I have some error

Code:
  2017/03/06 18:47:41 - Shell - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : (stderr) + str=1 2 3
2017/03/06 18:47:41 - Shell - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : (stderr) + arr=
2017/03/06 18:47:41 - Shell - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : (stderr) + echo
2017/03/06 18:47:41 - Shell - ERROR (version 6.1.0.1-196, build 1 from 2016-04-07 12.08.49 by buildguy) : (stderr) + exit 0
Please, help me to execute it.