title: Linux Bash Sed one liner change config value - with space or no space
body: <p>I need a Sed one liner to change a <code>key = value</code> pair in a config file, respecting the space or even no space between <code>key</code> and <code>=</code></p>
  
  <pre><code>// config_file could look like this
  key = oldValue
  key=oldValue
  key= oldValue
  key =oldValue
  keyABC = doNotMatchThis
  </code></pre>
  
  <p>What I got so far is this</p>
  
  <pre><code>sed -i '/key/s/= .*/= newValue/' config_file
  </code></pre>
  
  <p>The result will be </p>
  
  <pre><code>key = newValue
  key=oldValue
  key= newValue
  key =oldValue
  keyABC = newValue
  </code></pre>
  
  <p><code>keyABC</code> changed also (very bad!). How can I achieve this?</p>
  
  <p>What I want is</p>
  
  <pre><code>key = newValue
  key=newValue
  key= newValue
  key =newValue
  keyABC = doNotMatchThis
  </code></pre>