hush/shell/hush_test/hush-vars/var_posix1.tests
Denys Vlasenko a6ad397ea9 hush: fix more obscure ${var%...} cases
function                                             old     new   delta
add_till_closing_paren                               313     359     +46
builtin_exit                                          48      47      -1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-05-22 00:26:06 +02:00

53 lines
793 B
Plaintext
Executable File

unset var
echo Empty:${var#}
echo Empty:${var##}
echo Empty:${var#*}
echo Empty:${var##*}
echo Empty:${var%}
echo Empty:${var%%}
echo Empty:${var%*}
echo Empty:${var%%*}
var=
echo Empty:${var#}
echo Empty:${var##}
echo Empty:${var#*}
echo Empty:${var##*}
echo Empty:${var%}
echo Empty:${var%%}
echo Empty:${var%*}
echo Empty:${var%%*}
var=ababcdcd
echo ${var#ab}
echo ${var##ab}
echo ${var#a*b}
echo ${var##a*b}
echo ${var#?}
echo ${var##?}
echo ${var#*}
echo Empty:${var##*}
echo ${var#}}_tail
echo ${var#\}}_tail
echo ${var%cd}
echo ${var%%cd}
echo ${var%c*d}
echo ${var%%c*d}
echo ${var%?}
echo ${var%%?}
echo ${var%*}
echo Empty:${var%%*}
echo ${var#}}_tail
echo ${var#\}}_tail
echo ${var%\\*}
a=ab}; echo ${a%\}};
a=abc; c=c; echo ${a%${c}}
a=ab{{c; echo ${a%`echo {{c`}
echo End