#!/bin/bashs="key = oldValuekey=oldValuekey= oldValuekey =oldValuekeyABC = doNotMatchThis" sed '/^key *=/s/=.*/= newValue/' <<< "$s"
Standard input is empty
key = newValue key= newValue key= newValue key = newValue keyABC = doNotMatchThis
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!