Skip to content

Instantly share code, notes, and snippets.

@ixaxaar
Last active June 21, 2018 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ixaxaar/497fdfe6782ed368640999f270cd70e2 to your computer and use it in GitHub Desktop.
Save ixaxaar/497fdfe6782ed368640999f270cd70e2 to your computer and use it in GitHub Desktop.
Find and extract hadoop root url for use in bash scripts
#!/usr/bin/env bash
HH=`awk '/fs\.defaultFS/{getline; print}' /etc/hadoop/conf/core-site.xml `
HH1=`echo "${HH/<value>/}"`
HADOOP_ROOT=`echo "${HH1/<\/value>/}"`
echo $HADOOP_ROOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment