2 added 10 characters in body
source | link

I'm not very good with shell escape sequences, but it seems to me that you are. I assume that what you're missing for your use-case, therefore, is to implement if/else-type logic. Here's one way you can do it:

sed -e '\
        /.*MINOR.*/{ # If .*MINOR.* is matched\matched \
            # Code to set MINOR color\color \
        } \
        /.*MINOR.*/!{ # If .*MINOR.* is not matched\matched \
            /.*MAJOR.*/ { # If .*MAJOR.* is matched\matched \
            # Code to set MAJOR color\color \
            } \
            /.*MAJOR.*/!{ # If .*MAJOR.* is not matched\matched \
            # Code to set the default color\color \
            } \
         }'

Reference

I'm not very good with shell escape sequences, but it seems to me that you are. I assume that what you're missing for your use-case, therefore, is to implement if/else-type logic. Here's one way you can do it:

sed -e '\
        /.*MINOR.*/{ # If .*MINOR.* is matched\
            # Code to set MINOR color\
        }\
        /.*MINOR.*/!{ # If .*MINOR.* is not matched\
            /.*MAJOR.*/ { # If .*MAJOR.* is matched\
            # Code to set MAJOR color\
            }\
            /.*MAJOR.*/!{ # If .*MAJOR.* is not matched\
            # Code to set the default color\
            }\
         }'

Reference

I'm not very good with shell escape sequences, but it seems to me that you are. I assume that what you're missing for your use-case, therefore, is to implement if/else-type logic. Here's one way you can do it:

sed -e '\
        /.*MINOR.*/{ # If .*MINOR.* is matched \
            # Code to set MINOR color \
        } \
        /.*MINOR.*/!{ # If .*MINOR.* is not matched \
            /.*MAJOR.*/ { # If .*MAJOR.* is matched \
            # Code to set MAJOR color \
            } \
            /.*MAJOR.*/!{ # If .*MAJOR.* is not matched \
            # Code to set the default color \
            } \
         }'

Reference

1
source | link

I'm not very good with shell escape sequences, but it seems to me that you are. I assume that what you're missing for your use-case, therefore, is to implement if/else-type logic. Here's one way you can do it:

sed -e '\
        /.*MINOR.*/{ # If .*MINOR.* is matched\
            # Code to set MINOR color\
        }\
        /.*MINOR.*/!{ # If .*MINOR.* is not matched\
            /.*MAJOR.*/ { # If .*MAJOR.* is matched\
            # Code to set MAJOR color\
            }\
            /.*MAJOR.*/!{ # If .*MAJOR.* is not matched\
            # Code to set the default color\
            }\
         }'

Reference