fork(17) download
  1. #!/bin/bash
  2. s='keyA
  3. value:124
  4. keyB
  5. value:474
  6. keyC
  7. value:953
  8. keyB
  9. value:155'
  10.  
  11. sed -e '/keyB$/{n' -e 's/\(.*\):[0-9]*/\1:888/' -e '}' <<< "$s"
Success #stdin #stdout 0s 4692KB
stdin
Standard input is empty
stdout
keyA
value:124
keyB
value:888
keyC
value:953
keyB
value:888