mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix ${!foo@} and ${!foo*} to include 'foo' itself in search
These expansions are supposed to yield all variable names beginning with the indicated prefix. This should include the variable name that is identical to the prefix (as 'prefix' begins with 'prefix'). This bugfix is backported from the abandoned ksh 93v- beta, so AT&T intended this change. It also makes ksh work like bash in this. src/cmd/ksh93/sh/macro.c: varsub(): M_NAMESCAN: - Check if the prefix itself exists. If so, start with that. src/cmd/ksh93/tests/variables.sh: - Add tests for these expansions. src/cmd/ksh93/sh.1: - Fix the incomplete documentation of these expansions. src/cmd/ksh93/COMPATIBILITY: - Note the change as it's potentially incompatible in corner cases. Resolves: https://github.com/ksh93/ksh/issues/183
This commit is contained in:
parent
e58637752a
commit
4a8072e826
6 changed files with 32 additions and 3 deletions
|
@ -1274,9 +1274,14 @@ and
|
|||
inclusive using the same quoting rules as
|
||||
.BR @ .
|
||||
.TP
|
||||
.PD 0
|
||||
\f3${!\fP\f2prefix\^\fP\f3@}\fP
|
||||
.TP
|
||||
\f3${!\fP\f2prefix\^\fP\f3*}\fP
|
||||
Expands to the names of the variables whose names begin with
|
||||
These both expand to the names of the variables whose names begin with
|
||||
.IR prefix .
|
||||
The expansions otherwise work like \f3$@\fP and \f3$*\fP, respectively
|
||||
(see under \f2Quoting\fP below).
|
||||
.TP
|
||||
\f3${\fP\f2parameter\^\fP\f3:\-\fP\f2word\^\fP\f3}\fP
|
||||
If
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue