JBoss ON apply-updates.sh fails if Bourne Shell (sh) or DASH (dash) is used instead of Bourne Again Shell (bash)

Solution Unverified - Updated

Environment

  • Red Hat JBoss Operations Network (JBoss ON) 3.3 Update 11 and earlier
  • Linux
  • Unix
  • /bin/sh is not /bin/bash or /usr/bin/bash
  • Executing apply-updates.sh

Issue

  • apply-updates.sh fails to run on a system that uses /bin/sh or /bin/dash instead of /bin/bash

      296: ./apply-updates.sh: Bad substitution
    

Resolution

The apply-updates.sh utility provided in JBoss ON 3.3 Update 12 and later no longer uses Bash specific syntax for variable manipulation.

Root Cause

apply-updates.sh utilized a string manipulation syntax that was specific to Bash. Specifically ${p:13} to extract the value from $p beginning at index position 13 using 0-based indexing. This syntax is not compatible with sh or dash or any other shell that does not support the GNU Bourne-Again SHell extensions.

This issue was reported in This content is not included.Red Hat Bug 1638134

SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.