This is actually the correct behavior. By default, Jenkins invokes /bin/sh with the -e (errexit) flag, and expr has an exit status of 1 when the _expression_ evaluates to zero.

Some potential ways to deal with this:

  • Use the shell's arithmetic evaluation:
    foo=$((foo-1))
  • Use bc:
    foo=`echo "$foo-1" | bc`
  • Change the shell invocation as described by the help button for the Execute Shell build step
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to