I am a newbie in shell programming trying to run the below script. I am unsuccessful in printing the value assigned to the hadoop_home variable in the below example. Please help me in understanding my mistake.
#!/bin/sh
echo "Holaaaa"
hadoop_home= echo "$HADOOP_HOME"
java_home= echo "$JAVA_HOME"
echo "Printing variable values"
echo "${hadoop_home}"
echo "${java_home}"
On executing the above shell, it prints
Holaaaa
/usr/hdp/2.6.0.1-152/hadoop/
/usr/lib/jvm/java-1.7.0-openjdk-amd64/jre/
Printing variable values
The variable value in hadoop_home and java_home is empty. Why is it empty and how can I get the values assigned to these variables?