Skip to content

Commit

Permalink
Use grep and cut instead of awk
Browse files Browse the repository at this point in the history
  • Loading branch information
ctubbsii committed Nov 1, 2023
1 parent 291a78c commit 900c472
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/impl/run/hadoop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ trap 'echo "[ERROR] Error occurred at $BASH_SOURCE:$LINENO command: $BASH_COMMAN

"$HADOOP_HOME"/bin/hdfs namenode -format
"$HADOOP_HOME"/sbin/start-dfs.sh
#
# Yarn won't start on newer versions of Java
jver=$("$JAVA_HOME"/bin/java -version 2>&1 | awk -F '"' '/version/ {print $2}' | awk -F '.' '{print $1}')
jver=$("$JAVA_HOME"/bin/java -version 2>&1 | grep version | cut -f2 -d'"' | cut -f1 -d.)
if [[ $jver -gt 11 ]]; then
echo "Skipping yarn because it doesn't start on Java $jver"
else
Expand Down

0 comments on commit 900c472

Please sign in to comment.