Web lists-archives.com

Re: [Mingw-msys] Reconstruction of MSYS-1.0.11 test results.

Keith Marshall a écrit :
> [SNIP]
 > In fact, the original expression,
> appearing in the sed command above, is invalid, and while some sed 
> implementations may forgive it, MSYS sed correctly rejects it.
> Note the placement of the right hand brace, in the above expression; 
> it is immediately preceded by the `q' action verb, but POSIX is very 
> explicit here:--
> http://www.opengroup.org/onlinepubs/009695399/utilities/sed.html
> | [2addr] {function
> | function
> | ...
> | }
> |    Execute a list of sed functions only when the pattern space is 
> |    selected. The list of sed functions shall be surrounded by braces
> |    and separated by <newline>s, and conform to the following rules.
> |    The braces can be preceded or followed by <blank>s. The functions
> |    can be preceded by <blank>s, but shall not be followed by
> |    <blank>s. The <right-brace> shall be preceded by a <newline> and
> |    can be preceded or followed by <blank>s.      
> (note the explicit requirement for a *newline*, and *nothing* *else*, 
> preceding the right brace).
> IMHO, this is a classical example of clever misuse of an inappropriate 
> tool, leading to a fragile implementation; (and in this case it's so 
> fragile, that the breakage is built in from the outset).  [SNIP]

Version 4.1.1 of sed does accept the expression and, unless I am 
mistaken, there is no mention of the newline requirement in the info pages.

|    A group of commands may be enclosed between `{' and `}' characters.
|    This is particularly useful when you want a group of commands to
|    be triggered by a single address (or address-range) match.

It is a bug depending on whether you use a POSIX sed or a GNU sed.


Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
Mingw-msys mailing list