| Summary: | sh: behavior of backslash star inside parameter expansion | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | Stanislav Brabec <sbrabec> |
| Component: | Standard Compliance | Assignee: | unassigned |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | minor | CC: | busybox-cvs |
| Priority: | P5 | ||
| Version: | 1.13.x | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Host: | Target: | ||
| Build: | |||
Fixed in git. While at it, found and quashed two more bugs.
However, quoted version:
FOO="a*b\\*c"; echo "${FOO//\\*/-backslashstar-}"
is still broken, and is _hard_ to fix.
There is now a testcase for it:
Go to busybox/shell/ash_test in buld tree and run "run-all".
Examine ash-vars-var_bash4.tests.fail to see quoted expansion error.
|
There was a bug in expansion of star inside parameter in expressions like ${FOO//\\*/-star-}. In bash 2 and lower two backslashes were eaten for escaping of star. Since bash 3 the bug is fixed. The fix introduced a small change of the behavior (one backslash escapes second backslash). Also zsh already migrated to the fixed behavior. Busybox exactly follows (at least in version 1.13) the bash 2 behavior considered as broken. It would be nice to migrate it to the fixed behavior. Example: FOO="a*b\\*c" ; echo ${FOO//\\*/-backslashstar-} Bash 2, busybox: a-backslashstar-b-\backslashstar-c Bash 3, Bash 4, zsh: a*b-backslashstar-