title: how to get extract a word from a line in bash shell script
body: <p>i want to extract a word from a sentence in bash script .it uses both coma and space as separators.</p>
  
  <pre><code>ex:- date=crossed 122 name=foo , userid=234567 , sessionid=2233445axdfg5209  associd=2
  </code></pre>
  
  <p>I have above sentence in which the interesting part is name=foo .the key name is always same but the string foo may vary. also other parameters may or may not be there .</p>
  
  <p>i need to extract above  key value pair.
  so output would be :</p>
  
  <pre><code>name=foo
  </code></pre>
  
  <p>what is the best way to do it  in shell script?</p>
  
  <p>thanks!</p>