"Schwarz, Konrad" <konrad.schw...@siemens.com> wrote:

> As the Bourne Shell source code posted earlier showed, that implementation 
> did not clearly separate the phases: a character with its high-bit set was 
> quoted for all further purposes.

This worked with 7-bit ASCII.

As we have an 8-bit clean Bourne Shell since 1986 (SysVr3), this was replaced
by a '\\' prefix char. The code is now more complex, but the behavior is 
basically the same.

Yes, a character is passed through the shell with the quoting intact until it
calls "trim()" to remove this quoting. Where this happens influences the 
behavior.

People who implement shells usually control this by checking whether the shell 
behaves as expected. Whether the POSIX standard always mentions "quote removal"
at the right location was not yet verified as this would need a shell that was 
implemented only from reading the POSIX standard.

The reason for modifications in the POSIX standard with respect to the shell is 
to correct the current wording to follow the expectations of the users and the 
behavior of the reference shell.

Unfortunately, both POSIX and the reference shell have bugs. This is why we 
need 
to carefuly disuss issues with the shell.

For our discussion, ksh93 seems to misbehave with respect to quoting, while 
ksh88 seems to missbehave with respect to honoring quoting in the pattern 
matcher.

I believe we all agree that [a-c] and ["a-c"] should behave different.

Since the only difference in ["a-c"] is quoting, is is obvious hat the shell 
needs to honor quoting inside character classes as well in order to give a 
different behavior for [a-c] and ["a-c"].

The way the quoting and the pattern matcher has to be implemented depends on 
the expectations of the users. My impression is that we agree on how both
patterns should behave, so we just need to find a wording that matches the 
expectations.


Jörg

-- 
 EMail:jo...@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

Reply via email to