What I want to do is in the title.
Input:
apple -berry --sun house-roof computer-- orange number-43
Desired output:
apple house-roof computer-- orange number-43
In other words, only when a word starts with - or -- it should be removed. The closest I've got is:
echo "apple -berry --sun house-roof computer-- orange number-43" | sed -r 's/(-|--)\w+//g'
apple house computer-- orange number
Which is far from what I want. Could be solved with other tools? Cut?