Skip to content

Instantly share code, notes, and snippets.

@ixaxaar
Last active Jun 21, 2018
Embed
What would you like to do?
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