awk/constants
This commit is contained in:
parent
dbfe0e1407
commit
fd281ee8d0
2 changed files with 11 additions and 5 deletions
|
@ -50,6 +50,10 @@ BEGIN {
|
|||
if (match($0, RE_ALIAS, m)) {
|
||||
print m[1]
|
||||
}
|
||||
} else if (action == "constants") {
|
||||
if (match($0, RE_CONSTANT, m)) {
|
||||
print m[1]
|
||||
}
|
||||
} else if (action == "functions") {
|
||||
if (match($0, RE_FUNCTION, m)) {
|
||||
print m[1]
|
||||
|
|
12
sh/main.sh
12
sh/main.sh
|
@ -222,23 +222,25 @@ EOF
|
|||
_rwx_code_variables="$(rwx_parse_variables)"
|
||||
}
|
||||
rwx_parse_aliases() {
|
||||
echo "${_rwx_code}" |
|
||||
rwx_code |
|
||||
awk \
|
||||
--assign action="aliases" \
|
||||
"${_rwx_code_awk}"
|
||||
}
|
||||
rwx_parse_aliases_functions() {
|
||||
printf "%s" "${_rwx_code}" |
|
||||
rwx_code |
|
||||
awk \
|
||||
--assign action="aliases functions" \
|
||||
"${_rwx_code_awk}"
|
||||
}
|
||||
rwx_parse_constants() {
|
||||
printf "%s" "${_rwx_code}" |
|
||||
sed --silent "s|${RWX_REGEX_TARGET_CONSTANT}|\\1|p"
|
||||
rwx_code |
|
||||
awk \
|
||||
--assign action="constants" \
|
||||
"${_rwx_code_awk}"
|
||||
}
|
||||
rwx_parse_functions() {
|
||||
echo "${_rwx_code}" |
|
||||
rwx_code |
|
||||
awk \
|
||||
--assign action="functions" \
|
||||
"${_rwx_code_awk}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue