#!/bin/bash
s='world-123.hello-abcd
world-124.good
world-125.bye-abcd
world-126.bye'
sed 's:-[^.-]*$::' <<< "$s"
