bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: <<IFS=: foo=a:b:; cmd $foo>> documented


From: Chet Ramey
Subject: Re: <<IFS=: foo=a:b:; cmd $foo>> documented
Date: Tue, 12 Oct 2004 09:37:50 -0400

> That piece of code:
> 
> IFS=:
> set -f
> foo=a:b:
> printf '<%s>\n' $foo
> 
> gives different results depending on the shell.

In bash, and POSIX.2, and the other listed shells, trailing IFS characters
never result in a separate field.

They're field delimiters, so they're treated as field terminators, which is
not necessarily the same as field separators.  A trailing IFS character
delimits the final field.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]