my programs starts some services and store its output in tmp
variable and I want to match the variable's content if it starts with FATAL
keyword or not? and if it contains I will print Port in use
using echo
command
For example if tmp
contains FATAL: Exception in startup, exiting.
I can do it by sed
: echo $tmp | sed 's/^FATAL.*/"Port in use"/'
but I want to use the builtin if
to match the pattern.
How can I use the shell built in features to match REGEX?