[ 
https://issues.apache.org/jira/browse/KAFKA-1508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15028722#comment-15028722
 ] 

Boris Charpiot commented on KAFKA-1508:
---------------------------------------

Same problem occurs with the Windows batch files...
For example, bin/windows.kafka-run-class.bat should look like this:
set BASE_DIR={color:green}"%CD%"{color}
...
rem Classpath addition for kafka-core dependencies
for %%i in (%BASE_DIR%\core\build\dependant-libs-%SCALA_VERSION%\*.jar) do (
        call :concat {color:green}"%%i"{color}
)
...
:concat
IF -\["%CLASSPATH%"\] EQU \[""\]-{color:green}not defined CLASSPATH{color} (
  set CLASSPATH=-"%%i"-{color:green}%~1{color}
) ELSE (
  set CLASSPATH=%CLASSPATH%;-"%%i"-{color:green}%~1{color}
)

> Scripts Break When Path Has Spaces
> ----------------------------------
>
>                 Key: KAFKA-1508
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1508
>             Project: Kafka
>          Issue Type: Bug
>          Components: tools
>    Affects Versions: 0.8.1.1
>         Environment: Any *nix flavor where the full path name to the Kafka 
> deployment contains spaces
>            Reporter: Tim Olson
>            Assignee: Rekha Joshi
>            Priority: Minor
>
> 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:
> {code}
> # 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to