Allow arithmetic expansions

This commit is contained in:
tsi 2026-01-03 01:24:05 +01:00
parent c2bf5cec36
commit 275a1ccd84
No known key found for this signature in database

View file

@ -153,7 +153,8 @@ _redir_or_assign_word () {
_simple_variable='\$([[:alpha:]_][[:alnum:]]*|[-_$!*#[:digit:]])' \
_advanced_variable='\$\{([[:alpha:]_][[:alnum:]]*|[-_$!*#[:digit:]])[^}]*\}' \
_deprecated_arithmetic_eval='\$\[[^][]*\]' \
_cmd_subst_or_arithmetic_eval='\$\([^()]*\)' \
_cmd_subst='\$\([^()]*\)' \
_arithmetic_eval='\$\(\([^()]*\)\)' \
_process_substition='<\([^()]*\)' \
_escaped_char='\\.'
declare _part="$_simple_unquoted_word"
@ -163,7 +164,8 @@ _redir_or_assign_word () {
_part+="|$_simple_variable"
_part+="|$_advanced_variable"
_part+="|$_deprecated_arithmetic_eval"
_part+="|$_cmd_subst_or_arithmetic_eval"
_part+="|$_cmd_subst"
_part+="|$_arithmetic_eval"
_part+="|$_process_substition"
_part+="|$_escaped_char"
declare -r _word="($_part)+" \