Defect Report concerning: IEEE Std. 1003.2-1992, ISO/IEC 9945-2:1993 - Shell & Utilities
Clause: 3.6.5
PASC Interpretation Ref: pasc-1003.2-98
Topic: field splitting


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  #98

 _____________________________________________________________________________

	Interpretation Number:	XXXX
	Topic:			field splitting
	Relevant Sections:	3.6.5


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

	Date: Wed, 15 Mar 95 10:58:34 EST

A question regarding field splitting has come up.
Consider the following script:

IFS=:
x=:
set -- $x
echo $#

The question is whether there should be a terminal empty field.
Historically, ksh has reported the number of fields as 1.
Moreover, if the number of fields was considered to be 2, there
would be no way to describe a single empty field.

However, standard 1003.2-1992 seems unclear on this point.
The relevant section (3.6.5) is quoted below.  (An addition
I made for brevity and clarity is marked with asterisks).
Would appreciate formal clarification.

Many thanks,

"Otherwise **(i.e., IFS is set, non-null, and not equal to space
tab, newline)** the following rules shall be applied in sequence.
The term "IFS white space" is used to mean any sequence (zero or
more instances) of white-space characters that are in the IFS value
(e.g., if IFS contains <space><comma><tab>, any sequence of
<space> and <tab> characters is considered IFS white space).

a. IFS white space shall be ignored at the beginning and end of the input.
b. Each occurence in the input of an IFS character that is not IFS
   IFS white space, along with any adjacent IFS white space, shall
   delimit a field, as described previously.
c. Nonzero-length IFS white space shall delimit a field."



Interpretation response
------------------------
According to the example, the number of fields is 1.  The standard 
consistantly uses delimiter as field terminator, not field seperator 
and conforming implementations must conform to this.



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