diff --git a/sh/code.awk b/sh/code.awk index 76c7641..65cccd6 100644 --- a/sh/code.awk +++ b/sh/code.awk @@ -58,6 +58,10 @@ BEGIN { if (match($0, RE_FUNCTION, m)) { print m[1] } + } else if (action == "variables") { + if (match($0, RE_CONSTANT, m)) { + print m[1] + } } else if (action == "aliases functions") { if (match($0, RE_ALIAS, m)) { append(m[1]) diff --git a/sh/main.sh b/sh/main.sh index 7c5b831..51799ce 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -246,8 +246,10 @@ rwx_parse_functions() { "${_rwx_code_awk}" } rwx_parse_variables() { - printf "%s" "${_rwx_code}" | - sed --silent "s|${RWX_REGEX_TARGET_VARIABLE}|\\1|p" + rwx_code | + awk \ + --assign action="variables" \ + "${_rwx_code_awk}" } # ╭──────┬─────╮