Defect Report concerning: IEEE Std. 1003.2-1992, ISO/IEC 9945-2:1993 - Shell & Utilities
Clause: 3.9.4.2 page 140 l 914-918, 3.10.2 page 147
PASC Interpretation Ref: pasc-1003.2-169
Topic: for loop


This is an unapproved interpretation of PASC 1003.2-1992, ISO/IEC 9945-2:1993 - Shell & Utilities.

Use of the information contained in this unapproved document is at your own risk.

Last update: 20 April,2001


								1003.2-92  #169

 _____________________________________________________________________________


	Interpretation Number:	xxxx
	Topic:  for loop
	Relevant Sections:  3.9.4.2 page 140 l 914-918, 3.10.2 page 147 


PASC Interpretation Request: (Defect Report)
----------------------------  


	Date: 1999 Jul 19

------------------------------------------------------------------------ 

 7  Defect Report concerning (number and title of International Standard
    or DIS final text, if applicable): 

Shell & Utilities: IEEE Std 1003.2-1992 (ISO 9945-2:1993)

------------------------------------------------------------------------ 

 8  Qualifier (e.g. error, omission, clarification required):

2

Error=1 , Omission=2, Clarification=3

------------------------------------------------------------------------ 

 9  References in document (e.g. page, clause, figure, and/or table
    numbers):

3.9.4.2 for loop page 140 l 914-918, 3.10.2 page 147 l

------------------------------------------------------------------------ 

10  Nature of defect (complete, concise explanation of the perceived
    problem):


Is the following legal shell syntax, and what is the expected
behavior:
	for i in ; do echo Arg: $i; done

(Historical implementations generally allows this, with the
loop body not being executed.  This behaviour is useful for
automatic shell script generators.  However, the Standard
appears to disallow it, at least for Strictly Conforming
shell scripts.)


------------------------------------------------------------------------ 

11  Solution proposed by the submitter (optional):

Change the synopsis for p 140 line 915 from
	for name [in word ...]
to be
	for name [in [word ...]]
and in the grammar on p147 add new line between 1198 and 1199 
	"| For name linebreak in          sequential_sep do_group"




------------------------------------------------------------------------ 



Response
___________
	

	The standard clearly states that this is a syntax error according
	to the grammar.  However most known implementations permit the token
	after "in" explicitly to be null, and this issue has been forwarded
	to the sponsor.


Rationale
_________

None.

Notes to the project editor: (not part of the interpretation):

	Change the synopsis for p 140 line 915 from
		for name [in word ...]
	to be
		for name [in [word ...]]
	and in the grammar on p147 add new line between 1198 and 1199 
		"| For name linebreak in          sequential_sep do_group"

Forwarded to Interpretations group: 20 July 1999
Proposed resolution: 25 Oct 1999
Finalised: 21 March 2000