busybox/shell/ash_test/ash-vars/var_backslash1.right
Denys Vlasenko 0da6c813e1 hush: fix var_backslash1.tests
function                                             old     new   delta
o_addqblock                                            -     131    +131
append_str_maybe_ifs_split                            53     100     +47
expand_one_var                                      1872    1897     +25
encode_then_expand_vararg                            380     399     +19
sig_unblock                                           41      43      +2
sig_block                                             41      40      -1
sigprocmask_allsigs                                   33      31      -2
expand_vars_to_list                                 1080    1077      -3
wait_for_child_or_signal                             202     193      -9
o_addQstr                                            175      42    -133
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 4/5 up/down: 224/-148)           Total: 76 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2025-08-11 17:36:02 +02:00

35 lines
1.8 KiB
Text

a is '\*bc'
b is '\'
c is '*'
${a##?*} removes everything: || - matches one char, then all
${a##?"*"} removes \*: |bc| - matches one char, then *
${a##\*} removes nothing: |\*bc| - first char is not *
${a##\\*} removes everything: || - matches \, then all
${a##\\\*} removes \*: |bc| - matches \, then *
${a##?$c} removes everything: || - matches one char, then all
${a##?"$c"} removes \*: |bc| - matches one char, then *
${a##\\$c} removes everything: || - matches \, then all
${a##\\\$c} removes nothing: |\*bc| - matches \, but then second char is not $
${a##\\"$c"} removes \*: |bc| - matches \, then *
${a##$b} removes \: |*bc| - matches \
${a##"$b"} removes \: |*bc| - matches \
Single quote tests:
${a##?'*'} removes \*: |bc| - matches one char, then *
${a##'\'*} removes everything: || - matches \, then all
${a##'\'\*} removes \*: |bc| - matches \, then *
${a##'\*'} removes \*: |bc| - matches \, then *
${a##'\'$c} removes everything: || - matches \, then all
${a##'\'\$c} removes nothing: |\*bc| - matches \, but then second char is not $
${a##'\'"$c"} removes \*: |bc| - matches \, then *
${a##"$b"?} removes \*: |bc| - matches \, then one char
${a##"$b"*} removes everything: || - matches \, then all
${a##"$b""?"} removes nothing: |\*bc| - second char is not ?
${a##"$b""*"} removes \*: |bc| - matches \, then *
${a##"$b"\*} removes \*: |bc| - matches \, then *
${a##"$b"$c} removes everything:|| - matches \, then all
${a##"$b""$c"} removes \*: |bc| - matches \, then *
${a##"$b?"} removes nothing: |\*bc| - second char is not ?
${a##"$b*"} removes \*: |bc| - matches \, then *
${a##"$b$c"} removes \*: |bc| - matches \, then *