|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 0690 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 0690.
Report 0690 Actions
Problem Report Number 0690 Submitter's Classification Specification problem State Resolved Resolution Permanent Interpretation (PIN) Problem Resolution ID PIN.X.0083 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1997-07-07 08:00 Product Standard Commands and Utilities V2 (UNIX 95) Certification Program The Open Brand certification program Test Suite VSC version 4.1.4 Test Identification POSIX.upe/ex 277,379,387 Specification Commands and Utilities Issue 4 Version 2 Location in Spec See Problem Text Problem Summary PIN4C.00031 The tests may fail on implementations that conform to POSIX 1003.2b/D11. Problem Text
The tests may fail on implementations that adhere to historic practice
and begin with the last line instead of the first. Although POSIX.2
interpretation #64 reaffirms the behavior, the POSIX.2b draft reinstates
the historic behavior.
The tests in question verify the following assertions:
277:
When the range substitute /pattern/repl/ count command is invoked, then
the first instance of a string which matches the regular expression
pattern is replaced by the string repl on each of the first line
referenced by range and the following count-1 lines.
379:
When the [range] & command is invoked, then the substitution pair
/pattern/repl/ from the previous substitute is used and the first
instance of a string which matches the regular expression pattern is
replaced by the string repl on each line specified by range (default:
current line.)
387:
When the range ~ count command is invoked, then the substitution pair
/pattern/repl/, where pattern is the last regular expression used in any
command and repl is the replacement string from the previous substitute,
is used and the first instance of a string which matches the regular
expression pattern is replaced by the string repl on each of the first
line referenced by range and the following count-1 lines.
The portion of the assertions that is at issue is the description of
the range of lines that are affected when an ex command uses both a
range and a count. The text in these assertions is based on the
following language in XCU4 Issue 2, p. 305:
If both a count and a range are specified for a command that
uses them, the number of lines afected will be taken from the
count rather than the range. The starting line for the
command is taken to be the first line addressed by the range.
This language is taken directly from POSIX.2. However, this does not
describe the historical behavior of ex. IEEE interpretation
pasc-1003.2-064 addresses a large number of issues regarding vi and ex,
including this one. This interpretation request is too long to cite
here in its entirety, but it states in part:
(9) Command Descriptions
Section 5.10.7.2, page 523, line 1309
Historically, if both a count and range were specified, the offset
was from the LAST address, not the first. The offset in the case
was inclusive, so ":2,5c7" changes line 5 and 6 others. There is
one exception to this, the join command, for which the offset was
NOT inclusive, so the command "2,3join3" joins 3 lines, not 2.
Suggestion:
Conform to historic practice.
The response to this section was:
Q9:
The standard states the behavior for ranges and counts in ex, and
conforming implementations must conform to this. However, concerns
have been raised about this which are being referred to the sponsor.
Note also that the language on which the assertion was based is no
longer present in the most recent draft of POSIX.2b (rather, the
historical behavior is described), and that the test suite itself
contains a comment written to the journal to the effect that this
appears to be an error and will change. In view of this, the assertion
is clearly a grey area.
Test Output
-----------------start of test output------------------
************************************************************************
/tset/POSIX.upe/ex/ex_05.ex 1 Failed
Test Information:
Assertion #277 (C): specification of [range]substitute /pattern/str/
count
Note: The behavior associated with this assertion is expected
to change in a future revision of POSIX.2.
Expected exit code = 0; Received 1
diff of "ex_data_1" and "ex_exp_1":
5c5
< abc abc
---
> 012 abc
8c8
< abc abc abc
---
> 012 abc abc
Command failed: 'jrnl_file_diff ex_data_1 ex_exp_1'
************************************************************************
************************************************************************
/tset/POSIX.upe/ex/ex_07.ex 1 Failed
Test Information:
Assertion #379 (C): specification of ex "range & count" command
Note: The behavior associated with this assertion is expected
to change in a future revision of POSIX.2.
diff of "ex_data_1" and "ex_exp_1":
*** ex_data_1 Thu Sep 21 05:17:49 1995
--- ex_exp_1 Thu Sep 21 05:17:49 1995
***************
*** 1,5 ****
012 abc
- abc
- abc
- def
12
--- 1,5 ----
012 abc
12
+ 012
+ def
+ abc
Command failed: 'cmp_show ex_data_1 ex_exp_1'
Expected exit code = 0; Received 1
diff of "ex_data_2" and "ex_exp_2":
*** ex_data_2 Thu Sep 21 05:17:53 1995
--- ex_exp_2 Thu Sep 21 05:17:53 1995
***************
*** 1,5 ****
12
abc
! abc abc
def
abc abc abc
--- 1,5 ----
12
abc
! 012 abc
def
abc abc abc
Command failed: 'cmp_show ex_data_2 ex_exp_2'
************************************************************************
************************************************************************
/tset/POSIX.upe/ex/ex_07.ex 1 Failed
Test Information:
Assertion #387 (C): specification of ex "range ~ count" command
Note: The behavior associated with this assertion is expected
to change in a future revision of POSIX.2.
diff of "ex_data_1" and "ex_exp_1":
*** ex_data_1 Thu Sep 21 05:20:02 1995
--- ex_exp_1 Thu Sep 21 05:20:02 1995
***************
*** 1,6 ****
12
abc
- abc
- abc
def
! 012
--- 1,6 ----
12
+ 012
+ 012
abc
def
! abc
Command failed: 'cmp_show ex_data_1 ex_exp_1'
diff of "ex_data_2" and "ex_exp_2":
*** ex_data_2 Thu Sep 21 05:20:06 1995
--- ex_exp_2 Thu Sep 21 05:20:06 1995
***************
*** 1,7 ****
12
abc
abc
! abc abc
def
! abc abc abc
! 012
--- 1,7 ----
12
abc
abc
! 012 abc
def
! 012 abc abc
! abc
Command failed: 'cmp_show ex_data_2 ex_exp_2'
************************************************************************
------------------end of test output-------------------
Note: this output was from the vrpt report.
Review Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
Anticipating acceptance of the completely rewritten ex specification
in POSIX 2003.2b/D11 and the eventual alignment of the tests with it
a temporary interpretation is recommended.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Permanent Interpretation (PIN) Review Conclusion
A Permanent Interpretation is granted.
Problem Reporting System Options:
- View Report 0690
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority