title: Match a string in a file and print entire value using sed or awk
body: <p>I am trying to extract the value associated with string, but need an optimal way.</p>
  
  <pre><code>name=sandeep login_name=sn003 version=3.0 rel_no=456....
  </code></pre>
  
  <p>The above text is stored in a file.<br>
  I am trying to search for a part of string and then print the entire value.</p>
  
  <p>Say I need to search using <code>login</code> and output should be</p>
  
  <pre><code>login_name=sn003
  </code></pre>
  
  <p>I have tried the command </p>
  
  <pre><code>cat filename | awk -F" " '{print $2}'
  </code></pre>
  
  <p>If <code>login_name</code> is not the second field this will not print though.<br>
  How can i search for a string in any position and then print the result ?  </p>
  
  <p>Thanks in advance.</p>