title: Get XML tag values through shell script
body: <p>I need to fetch username and password values from sample XML tags</p>
  
  <pre><code>&lt;CommCellUser userName="~!@#$%^&amp;*()_+`1=- 23)()();';" password="":&gt;?&lt;,./;'|}{[]  &gt;&lt;:"/" &lt;/CommCellUser&gt;
  </code></pre>
  
  <p>The value will be in double quotes. That value may contain double quotes and any other special characters including spaces .</p>
  
  <pre><code>comm_cell_line=`grep "CommCellUser" /filename | head -1`
  userName=`echo "$comm_cell_line" | awk '{print $2}' | cut -d"\"" -f2`
  passwd=`echo "$comm_cell_line" | awk '{print $3}' | cut -d"\"" -f2`
  </code></pre>
  
  <p>Fetching like this miss so many cases. Because it may contain spaces and special characters in value.</p>
  
  <p>Please help .</p>