From 1b20f7428fd9ebbc2637ac8d517d760047b176d4 Mon Sep 17 00:00:00 2001 From: Eric Chang Date: Wed, 11 Dec 2024 08:41:11 +0800 Subject: [PATCH] refactor(init/hive): use sed to replace tail -f command --- init/hive/init.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init/hive/init.sh b/init/hive/init.sh index 144347c..935c2f8 100644 --- a/init/hive/init.sh +++ b/init/hive/init.sh @@ -17,10 +17,9 @@ # under the License. # -# remove command line `tail -f /dev/null` in the `/usr/local/sbin/start.sh`, so we can run subsequent commands -if [[ $(tail -n 1 /usr/local/sbin/start.sh) == 'tail -f /dev/null' ]]; then - sed -i '$d' /usr/local/sbin/start.sh -fi +# remove command `tail -f /dev/null` in `/usr/local/sbin/start.sh`, so we can run subsequent commands +sed -i -E 's/tail -f \/dev\/null//g' /usr/local/sbin/start.sh + cp /tmp/hive/core-site.xml /tmp/hadoop-conf /bin/bash /usr/local/sbin/start.sh hdfs dfs -mkdir -p /user/gravitino