Your message dated Tue, 22 Jan 2013 09:12:56 +0000 (UTC)
with message-id <[email protected]>
and subject line Re: Bug#698678: "*" in ${name/pattern/string} matches no
character string
has caused the Debian Bug report #698678,
regarding "*" in ${name/pattern/string} matches no character string
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
698678: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=698678
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: mksh
Version: 40.9.20120630-4
Hi,
I do not match character string at all when I appoint only "*" in a pattern
of ${name/pattern/string}:
$ v=abc; print ${v/*/0}
abc
$ print ${v/?*/0}
0
--- End Message ---
--- Begin Message ---
Jonny dixit:
>I do not match character string at all when I appoint only "*" in a pattern
>of ${name/pattern/string}:
>$ v=abc; print ${v/*/0}
>abc
>$ print ${v/?*/0}
>0
This is not a bug but a user error. An extglob matching everything
or nothing cannot be applied, that’s why it’s short-circuited. You
should just write
$ print 0
instead of
$ print ${v/*/0}
in the first place. It makes no sense.
The technical reason, beyond that, is that the globbing code needs
some sort of anchor. Given the nonsensicality, I don’t think adding
code to check for this special case makes sense, it’s slow enough
as is already.
bye,
//mirabilos
--
„nein: BerliOS und Sourceforge sind Plattformen für Projekte, github ist
eine Plattform für Einzelkämpfer“
-- dieses Zitat ist ein Beweis dafür, daß auch ein blindes Huhn
mal ein Korn findet, bzw. – in diesem Fall – Recht haben kann
--- End Message ---