title: Extract single word using grep
body: <p>I have following types of strigs. Each of them are part of a large string. </p>
  
  <ol>
  <li><code>...... UUID: a062832a; UID: Z6IxbK9; UUID: null; ......</code></li>
  <li><code>...... UUID: a062832a; UID: Z6IxbK9; ......</code></li>
  <li><code>...... UID: Z6IxbK9; UUID: null; ......</code></li>
  </ol>
  
  <p>I want to extract the value associated with UID, i.e <code>Z6IxbK9</code>. Right now Im using following expression to extract it.</p>
  
  <pre><code>value=`echo $line | grep -o '\&lt;UID.*\&gt;' | awk -F\; '{ print $1 }' | cut -d: -f2 | tr -d ' '`
  </code></pre>
  
  <p>I feel this not the efficient way of doing this. I'm invoing four different commands which is slowing down the processing of a big file.</p>
  
  <p>Can anyone suggest a better solution. </p>