WG15 Defect Report Ref: 9945-2-99
Topic: set -x


This is an approved interpretation of 9945-2:1993.

.

Last update: 1997-05-20


								9945-2-99

 _____________________________________________________________________________

	Topic:			set -x
	Relevant Sections:	3.14.11


Defect Report:
-----------------------
	From: andrew@novell.co.uk (Andrew Josey)
	Date: Thu, 16 Mar 1995 07:32:02 +0000

This is an interpretation request for ISO/IEC 9945-2:1993.

	Topic : shell , set -x
	Publication: 9945-2:1993

POSIX.2 requires that "set -x" will write a trace
for each command after the shell expands the command and before
it executes it.  The following script indicates that execution
occurs before the trace is written, as the call to "set +x" is
not recorded:

set -x
VAR1=1
VAR2=2
set +x
VAR3=3

This behaviour is different to present Korn Shell, which
has historically treated set +x specially; not tracing this.
Several tools uses this to do selective tracing.  We see that
the standard doesn't specify a special case for this, but we
know that it will break existing practice if we change this behavior.
All other commands are traced before execution.

Did the standard really intend to mandate the Bourne Shell behavior 
over Korn Shell, or was it just an oversight that they did not single out 
set +x as a special case?


Interpretation response
------------------------
The standard clearly states the behavior of set +x, and conforming 
implementations must conform to this.  However, concerns have been 
raised about this which are being referred to the sponsor.



Rationale:
None

Forwarded to Interpretations group: Mar 16 1995
Proposed resolution circulated: May 16th
Comments due: June 15th
Finalised: June 16th 1995