hush: support ${var:EXPR:EXPR}!

function                                             old     new   delta
handle_dollar                                        574     681    +107
expand_and_evaluate_arith                              -      77     +77
expand_vars_to_list                                 2302    2374     +72
add_till_closing_bracket                             359     368      +9
builtin_exit                                          48      47      -1
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 3/1 up/down: 265/-1)            Total: 264 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-05-22 03:12:29 +02:00
parent ddc62f64ba
commit 1e811b1231
3 changed files with 148 additions and 82 deletions

View File

@@ -39,3 +39,13 @@ f:1:2=|12|
f::2 =|01|
f:1: =||
f:: =||
Substrings with expressions
f =|01234567|
f:1+1:2+2 =|2345|
f:-1:2+2 =|01234567|
f:1:f =|1234567|
f:1:$f =|1234567|
f:1:${f} =|1234567|
f:1:${f:3:1} =|123|
f:1:1`echo 1`=|1|
Done