fork(1) download
  1. #!/bin/bash
  2. s="#Foo bar
  3. Foo bar
  4. #Baz foo
  5. Baz foo"
  6. perl -pe 's/o{2,}/"O" x length($&)/ge' <<< "$s"
Success #stdin #stdout 0.01s 5432KB
stdin
Standard input is empty
stdout
#FOO bar
FOO bar
#Baz fOO
Baz fOO