import re


def fix_env_var_syntax(oldstr):
    """Replace '<ENV: env_var>' with '${env_var}' througout the input string."""
    newstr = oldstr
    for key in re.findall(r"<ENV:([^>]+)>", oldstr):
        newstr = newstr.replace(rf"<ENV:{key}>", "${%s}" % key)
    return newstr