You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/11/17 03:42:01 UTC

[GitHub] [dolphinscheduler] zhongjiajie commented on a change in pull request #6782: [fix: #6781] Executing install.sh failed when password and others contain @

zhongjiajie commented on a change in pull request #6782:
URL: https://github.com/apache/dolphinscheduler/pull/6782#discussion_r750858848



##########
File path: install.sh
##########
@@ -21,6 +21,15 @@ workDir=`cd ${workDir};pwd`
 
 source ${workDir}/conf/config/install_config.conf
 
+charEscape(){
+    inputParam=$1
+    if [[ $1 =~ '@' ]]; then
+        tmp=$(echo inputParam | sed "s/@/\\\\@/g")

Review comment:
       It seem we miss shell variable syntax here @tracehh 
   ```suggestion
           tmp=$(echo ${inputParam} | sed "s/@/\\\\@/g")
   ```
   
   but the most important thing is, could we reduce the complexity of function? maybe just
   
   ```shell
   function charEscape(){
     echo ${$1//@/\\\\@} 
   }
   ```
   according to https://stackoverflow.com/a/2871187/7152658




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org