ash: add testsuite entry for POSIX-mandated ${var#word} ${var##word}
${var%word} ${var%%word}
This commit is contained in:
parent
9bc80d7062
commit
033424a213
10
shell/ash_test/ash-vars/var_posix1.right
Normal file
10
shell/ash_test/ash-vars/var_posix1.right
Normal file
@ -0,0 +1,10 @@
|
||||
abcdcd
|
||||
abcdcd
|
||||
abcdcd
|
||||
cdcd
|
||||
babcdcd
|
||||
ababcd
|
||||
ababcd
|
||||
ababcd
|
||||
abab
|
||||
ababcdc
|
13
shell/ash_test/ash-vars/var_posix1.tests
Executable file
13
shell/ash_test/ash-vars/var_posix1.tests
Executable file
@ -0,0 +1,13 @@
|
||||
var=ababcdcd
|
||||
|
||||
echo ${var#ab}
|
||||
echo ${var#a*b}
|
||||
echo ${var##ab}
|
||||
echo ${var##a*b}
|
||||
echo ${var#?}
|
||||
|
||||
echo ${var%cd}
|
||||
echo ${var%c*d}
|
||||
echo ${var%%cd}
|
||||
echo ${var%%c*d}
|
||||
echo ${var%?}
|
Loading…
Reference in New Issue
Block a user