Get string after character [duplicate] Get string after character [duplicate] bash bash

Get string after character [duplicate]


Use parameter expansion, if the value is already stored in a variable.

$ str="GenFiltEff=7.092200e-01"$ value=${str#*=}

Or use read

$ IFS="=" read name value <<< "GenFiltEff=7.092200e-01"

Either way,

$ echo $value7.092200e-01


For the text after the first = and before the next =

cut -d "=" -f2 <<< "$your_str"

or

sed -e 's#.*=\(\)#\1#' <<< "$your_str"

For all text after the first = regardless of if there are multiple =

cut -d "=" -f2- <<< "$your_str"


echo "GenFiltEff=7.092200e-01" | cut -d "=" -f2