Skip to content

Instantly share code, notes, and snippets.

@thomashartm
Last active May 14, 2016 19:17
Show Gist options
  • Save thomashartm/224364937fdbdb6d9b6b to your computer and use it in GitHub Desktop.
Save thomashartm/224364937fdbdb6d9b6b to your computer and use it in GitHub Desktop.
Parse xml elements from settings.xml into shell variables
username=$(grep -o '<username>.*</username>' ~/.m2/settings.xml | sed 's/\(<username>\)//g' | sed 's/\(<\/username>\)//g')
password=$(grep -o '<password>.*</password>' ~/.m2/settings.xml | sed 's/\(<password>\)//g' | sed 's/\(<\/password>\)//g')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment