You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Hequn Cheng (Jira)" <ji...@apache.org> on 2020/01/24 01:12:00 UTC

[jira] [Updated] (FLINK-13827) Shell variable should be escaped in start-scala-shell.sh

     [ https://issues.apache.org/jira/browse/FLINK-13827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hequn Cheng updated FLINK-13827:
--------------------------------
    Summary: Shell variable should be escaped in start-scala-shell.sh  (was: shell variable should be escaped in start-scala-shell.sh)

> Shell variable should be escaped in start-scala-shell.sh
> --------------------------------------------------------
>
>                 Key: FLINK-13827
>                 URL: https://issues.apache.org/jira/browse/FLINK-13827
>             Project: Flink
>          Issue Type: Bug
>          Components: Scala Shell
>    Affects Versions: 1.9.0, 1.10.0
>            Reporter: Zili Chen
>            Assignee: Zili Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.9.2, 1.10.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> {code:java}
> diff --git a/flink-scala-shell/start-script/start-scala-shell.sh b/flink-scala-shell/start-script/start-scala-shell.sh
> index b6da81af72..65b9045584 100644
> --- a/flink-scala-shell/start-script/start-scala-shell.sh
> +++ b/flink-scala-shell/start-script/start-scala-shell.sh
> @@ -97,9 +97,9 @@ log_setting="-Dlog.file="$LOG" -Dlog4j.configuration=file:"$FLINK_CONF_DIR"/$LOG
>  
>  if ${EXTERNAL_LIB_FOUND}
>  then
> -    $JAVA_RUN -Dscala.color -cp "$FLINK_CLASSPATH" $log_setting org.apache.flink.api.scala.FlinkShell $@ --addclasspath "$EXT_CLASSPATH"
> +    $JAVA_RUN -Dscala.color -cp "$FLINK_CLASSPATH" "$log_setting" org.apache.flink.api.scala.FlinkShell $@ --addclasspath "$EXT_CLASSPATH"
>  else
> -    $JAVA_RUN -Dscala.color -cp "$FLINK_CLASSPATH" $log_setting org.apache.flink.api.scala.FlinkShell $@
> +    $JAVA_RUN -Dscala.color -cp "$FLINK_CLASSPATH" "$log_setting" org.apache.flink.api.scala.FlinkShell $@
>  fi
>  
>  #restore echo
> {code}
> otherwise it is error prone when {{$log_setting}} contain arbitrary content. 
> For example, if the parent dir contain whitespace, said {{flink-1.9.0 2}}, then {{bin/start-scala-shell.sh local}} will fail with
> {{Error: Could not find or load main class 2.log.flink\-\*\-scala\-shell\-local\-\*.log}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)