[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: field splitting with IFS non-whitespace
From: |
Chet Ramey |
Subject: |
Re: field splitting with IFS non-whitespace |
Date: |
Fri, 14 Jan 2011 21:15:19 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.8) Gecko/20100802 Lightning/1.0b2 Thunderbird/3.1.2 |
On 1/11/11 3:36 PM, Greg Wooledge wrote:
> POSIX 2.6.5 Field Splitting [1] says, in part,
>
> 1. If IFS is <space><tab><newline> or unset, ...
> 2. If IFS is null, ...
> 3. Otherwise, ...
> b. Each occurrence in the input of an IFS character that is not IFS
> white space, along with any adjacent IFS white space, shall delimit
> a field, as described previously.
>
> I'm attempting to understand what exactly "delimit a field" means.
The standard is consistent -- or tries to be -- in saying that delimit
a field means terminate a field. For instance, the current version of
the standard says, in 2.6.5:
"The shell shall treat each character of the IFS as a delimiter and use
the delimiters as field terminators to split the results of parameter
expansion and command substitution into fields"
A discussion nearly identical to this one took place in February/March
2005, and should be available in the austin-group mailing list archives.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/