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

Karaf shell scripts don't work on Solaris 10

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.2.5
    • 4.3.0, 4.2.6
    • karaf
    • None
    • Solaris 10 x86-64 using default shell

    Description

      Trying to launch Karaf from default shell (which, from what I uderstand, is Bourne Shell) on a Solaris 10 platform results in the following error:

      # ./karaf
      ./karaf: erreur de syntaxe ligne 30: `READLINK_EXISTS=$' inattendue\{code}
      

      On an other hand, running Karaf shell scripts using another shell (as ksh) works fine:

      # ksh karaf
      

      The following shell scripts are impacted: client, inc, shell, start, status, stop

      # ./client
      ./client: erreur de syntaxe ligne 30: `READLINK_EXISTS=$' inattendue
      
      # ./inc
      ./inc: erreur de syntaxe ligne 77: `MAX_FD_LIMIT=$' inattendue
      
      # ./shell
      ./shell: erreur de syntaxe ligne 30: `READLINK_EXISTS=$' inattendue
      
      # ./start
      ./start: erreur de syntaxe ligne 30: `READLINK_EXISTS=$' inattendue
      
      # ./status
      ./status: erreur de syntaxe ligne 30: `READLINK_EXISTS=$' inattendue
      
      # ./stop
      ./stop: erreur de syntaxe ligne 30: `READLINK_EXISTS=$' inattendue
      

      This is because these shell scripts uses the $() syntax for command substitution, which is not compatible with some very oldest of non-POSIX-compatible bourne-shells (such as the default Shell of Solaris 10).

      To enhance the portability of these scripts, an alternative would be to use the legacy command substitution syntax `...`. Indeed, while the $() syntax is recommended as the way to go (mainly because it makes nesting command substitutions easier and allows better readibility), the backtick one is still valid, even providing better portability.
       
      Source: Why is $(...) preferred over `...` (backticks)? at BashFAQ

      Note that this issue can probably be linked to KARAF-5190.

       

      Attachments

        Issue Links

          Activity

            People

              jbonofre Jean-Baptiste Onofré
              baptistedaroit Baptiste DA ROIT
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: