| Summary: | app-shells/dash - parameter expansion for positional parameters different from man page | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Karsten <k-langeloh> |
| Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kfm |
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
That's outputting "$10" as the value of "$1", followed by the string "0", exactly like the spec says =) Nevermind! I had your expected/actual cases reversed. Sorry for the noise. Reported upstream at https://www.mail-archive.com/dash@vger.kernel.org/msg01878.html This can be closed as no affected versions remain in the gentoo repo. |
Maybe an upstream problem and not gentoo specific. The man page of app-shells/dash states under 'Parameter Expansion': "The parameter name or symbol can be enclosed in braces, which are optional except for positional parameters with more than one digit or [...]" IIRC this is also what is defined by the posix standard. The behaviour though is that a shell script using dash as shell accepts $10 (without {}) as the 10th parameter. - testscript.sh ---- #!/bin/dash echo $1-$10-${10}- ---- when called like: ./testscript.sh first should print: 'first-first0--' but prints instead: 'first---'