Use the t command after each s command to branch to the end of the script if a substitution was made:
sed -e 's/something/else/;t' \ -e 's/one/two/;t' \ -e 's/two/three/;t' <<<"one" Here, the t command after the last substitution is not needed, but if you generate this code automatically, there is no problem letting it suffix each s, even the last.