Details
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
- is duplicated by
-
KAFKA-2780 kafka-server-start.sh globbing issue
- Resolved
- is related to
-
KAFKA-3692 Wildcards in External CLASSPATH may cause it not be included in the CLASSPATH
- Resolved