for example, I have a string variable that reads:
AAA=<?=\${AAA}=?>
BBB=<?=\${BBB}=?>
<%=[ "\${Alias}" == "" ]=%>
CCC=\${CCC}
I want to implement regular substitution, generating the string as
AAA=<?=${AAA}=?>
BBB=<?=${BBB}=?>
<%= [ "${Alias}" == "" ] =%>
CCC=\${CCC}
or
AAA=${AAA}
BBB=${BBB}
[ "${Alias}" == "" ]
CCC=\${CCC}
how to achieve it? I tried sed, etc., but the ability of Shell is limited, so it is difficult to achieve the effect.
Note: I want to achieve the effect of template engine replacement.