Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-1508

Scripts Break When Path Has Spaces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.8.1.1
    • None
    • tools
    • Any *nix flavor where the full path name to the Kafka deployment contains spaces

    Description

      All the shell scripts in bin use the idom
      $(dirname $0)
      but this produces the error
      usage: dirname path
      if the path contains spaces. The correct way to get the dirname is to use:
      "$(dirname "$0")"
      and subsequently wrap the result in quotes when it is used. For example, the file bin/kafka-run-class.sh should look like this starting line 23:

      # BUGFIX: quotes added
      base_dir="$(dirname "$0")/.."
      
      # create logs directory
      # BUGFIX: quotes added
      LOG_DIR="$base_dir/logs"
      if [ ! -d "$LOG_DIR" ]; then
          # BUGFIX: quotes added around $LOG_DIR
          mkdir "$LOG_DIR"
      fi
      # ...
      # BUGFIX: quotes added
      for file in "$base_dir/core/build/dependant-libs-${SCALA_VERSION}/*.jar";
      do
        CLASSPATH=$CLASSPATH:"$file"
      done
      

      Attachments

        Issue Links

          Activity

            People

              rekhajoshm Rekha Joshi
              shamme Tim Olson
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: