Guest User

Untitled

a guest
Oct 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. # Pull the username and password out of the xml file and into local vars
  2. # Run the output through sed to escape & and _ characters for MySQL
  3. # Note: the shell quoting here gets a little rough. The final command is:
  4. # sed -e 's/[%_]/\&/g'
  5. read dbuser dbpass <<<$(xmap \
  6. 'xmlstarlet sel -t -v "//controller-config/database/@" '${XML_FILE}' \
  7. | sed -e '\''s/[%_]/\\\\&/g'\' \
  8. username password)
Add Comment
Please, Sign In to add comment