Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-4371

karaf shell scripts use "local" which is not a posix compliant

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0, 4.0.5
    • Component/s: karaf
    • Labels:
      None

      Description

      karaf shell scripts use "local" in function pathCanonical which is not posix compliant:

      pathCanonical() {
          local dst="${1}"
          while [ -h "${dst}" ] ; do
              ls=`ls -ld "${dst}"`
              link=`expr "$ls" : '.*-> \(.*\)$'`
              if expr "$link" : '/.*' > /dev/null; then
                  dst="$link"
              else
                  dst="`dirname "${dst}"`/$link"
              fi
          done
          local bas=`basename "${dst}"`
          local dir=`dirname "${dst}"`
          if [ "$bas" != "$dir" ]; then
              dst="`pathCanonical "$dir"`/$bas"
          fi
          echo "${dst}" | sed -e 's#//#/#g' -e 's#/./#/#g' -e 's#/[^/]*/../#/#g'
      }
      

      As a consequence the script fails on non-bash shells:

      bin/karaf[169]: local: not found [No such file or directory]
      bin/karaf[179]: local: not found [No such file or directory]
      bin/karaf[180]: local: not found [No such file or directory]
      

        Attachments

          Activity

            People

            • Assignee:
              ffang Freeman Fang
              Reporter:
              lb Luca Burgazzoli
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: