fork(3) download
  1. #!/bin/bash
  2. s='foo-bar-foo[Foo - Bar]'
  3. sed -E ':a; s/^([^[-]+)-/\1/; ta' <<< "$s"
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
foobarfoo[Foo - Bar]