Tim Olson created KAFKA-1508:
--------------------------------
Summary: 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
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.2#6252)