You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by wa...@apache.org on 2024/04/15 12:19:18 UTC

(seatunnel) branch dev updated: [Fix][Script] Fix lose jvm option when jvm_options file not end with `\n` (#6693)

This is an automated email from the ASF dual-hosted git repository.

wanghailin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git


The following commit(s) were added to refs/heads/dev by this push:
     new dba99538b5 [Fix][Script] Fix lose jvm option when jvm_options file not end with `\n` (#6693)
dba99538b5 is described below

commit dba99538b525f0631f49ed9fcd503346590c4018
Author: Jia Fan <fa...@qq.com>
AuthorDate: Mon Apr 15 20:19:13 2024 +0800

    [Fix][Script] Fix lose jvm option when jvm_options file not end with `\n` (#6693)
---
 seatunnel-core/seatunnel-starter/src/main/bin/seatunnel-cluster.sh | 5 ++---
 seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh         | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel-cluster.sh b/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel-cluster.sh
index e85a97e67a..1eda5a15e1 100755
--- a/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel-cluster.sh
+++ b/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel-cluster.sh
@@ -97,9 +97,8 @@ fi
 
 CLASS_PATH=${APP_DIR}/lib/*:${APP_JAR}
 
-while read line
-do
-    if [[ ! $line == \#* ]] && [ -n "$line" ]; then
+while IFS= read -r line || [[ -n "$line" ]]; do
+    if [[ ! $line == \#* ]]; then
         JAVA_OPTS="$JAVA_OPTS $line"
     fi
 done < ${APP_DIR}/config/jvm_options
diff --git a/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh b/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh
index b95800f1c2..e7754e3975 100755
--- a/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh
+++ b/seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh
@@ -101,9 +101,8 @@ fi
 
 CLASS_PATH=${APP_DIR}/lib/*:${APP_JAR}
 
-while read line
-do
-    if [[ ! $line == \#* ]] && [ -n "$line" ]; then
+while IFS= read -r line || [[ -n "$line" ]]; do
+    if [[ ! $line == \#* ]]; then
         JAVA_OPTS="$JAVA_OPTS $line"
     fi
 done < ${APP_DIR}/config/jvm_client_options