fork download
  1. #!/bin/bash
  2. s='a chair x 0 y
  3. a table x 0 y
  4. a window x 0 y
  5. a computer x 0 y'
  6.  
  7. sed -E 's/^(\S+\s+window\s+\S+\s+)0(\s)/\1111\2/' <<< "$s"
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
a chair x 0 y
a table x 0 y
a window x 111 y
a computer x 0 y