fork download
  1. #!/bin/bash
  2. s='world-123.hello-abcd
  3. world-124.good
  4. world-125.bye-abcd
  5. world-126.bye'
  6. sed 's:-[^.-]*$::' <<< "$s"
  7.  
Success #stdin #stdout 0s 4412KB
stdin
Standard input is empty
stdout
world-123.hello
world-124.good
world-125.bye
world-126.bye