Should move shell module from sh to bash?

Hi,

Refer to shell module doc, current it use /bin/sh to execute shell command, most time it works fine, but for following example, the result from Ubuntu is different.

  • shell: command -v nwef

Since in Ubuntu, /bin/sh → dash, the command will return 127, not 1

$ cat test.sh
command -v nwef
echo $?

$ sh test.sh
127
$ ./test.sh
1
$ bash test.sh
1

I don’t know why dash return 127, it will cause result is not consistent in different platform.

If shell module move to bash, the result will be same in different Platform, and bash exist in most platform.

Thanks,
Linbo

Unless I'm missing something, can't you just set executable: /bin/bash ?

The /bin/sh can be very different shells on diff platforms, when linked to bash it is very forgiving about bashisms in posix sh, but other shells are not. If you are using bash shell syntax, point at bash, not sh, to avoid these errors.

Sorry, I miss the executable params. Thanks for your reply.

在 2014年2月9日星期日UTC+8上午1时08分40秒,Brian Green写道: