hush/shell/hush_test/hush-vars/param_expand_bash_substring.right
Denys Vlasenko 1e811b1231 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>
2010-05-22 03:12:29 +02:00

52 lines
749 B
Plaintext

hush: syntax error: unterminated ${name}
hush: syntax error: unterminated ${name}
hush: syntax error: unterminated ${name}
hush: syntax error: unterminated ${name}
0123456789
1 =||
1:1 =||
1:1:2=||
1::2 =||
1:1: =||
1:: =||
1 =|0123|
1:1 =|123|
1:1:2=|12|
1::2 =|01|
1:1: =||
1:: =||
f =||
f:1 =||
f:1:2=||
f::2 =||
f:1: =||
f:: =||
f =||
f:1 =||
f:1:2=||
f::2 =||
f:1: =||
f:: =||
f =|a|
f:1 =||
f:1:2=||
f::2 =|a|
f:1: =||
f:: =||
f =|0123456789|
f:1 =|123456789|
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