On 10/20/15 10:21 AM, ziyunfei wrote:
> Quoting from the bash manual: 
> 
> "If IFS has a value other than the default, then sequences of the whitespace 
> characters *space and tab* are ignored at the beginning and end of the word, 
> as long as the whitespace character is in the value of IFS (an IFS whitespace 
> character)."
> 
> If this is true, then the following script
> 
> $ IFS=$'\n'
> $ a=$'\n1\n2\n'
> $ printf "%s\n" $a
> 1
> 2
> 
> should print <> <1> <2> 3 fields, but it doesn't.
> 
> So I guess *space and tab* should be replace by *space, tab and newline* in 
> that section.

That seems reasonable.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to