ash: support for && and || in [[ expr ]]; add testsuite checks

This commit is contained in:
Denis Vlasenko
2008-03-25 07:49:43 +00:00
parent b02cea1212
commit 80591b0a00
7 changed files with 115 additions and 12 deletions

View File

@ -0,0 +1,24 @@
var=abc123dcba123
echo ${var/d/x}
echo ${var/c/x}
echo ${var//c/x}
echo ${var/[123]/x}
echo ${var//[123]/x}
echo ${var/c*/x}
echo ${var/*c/x}
# must match longest match: result is "abx23"
echo ${var/c*1/x}
# empty replacement - 2nd slash can be omitted
echo ${var/[123]}
echo ${var//[123]}
### ash doesn't support
### # match only at the beginning:
### echo ${var/#a/x}
### echo ${var/#b/x} # should not match
### echo ${var//#b/x} # should not match
### # match only at the end:
### echo ${var/%3/x}