[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields
From: |
Chet Ramey |
Subject: |
Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields |
Date: |
Fri, 24 Feb 2017 16:28:40 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 |
On 2/24/17 4:07 PM, Chet Ramey wrote:
> On 2/24/17 3:20 PM, Grisha Levit wrote:
>>
>>
>> On Sat, Feb 18, 2017 at 8:35 PM, Martijn Dekker <martijn@inlv.org
>> <mailto:martijn@inlv.org>> wrote:
>>>
>>> When IFS is null, unquoted $* within an unquoted substitution (e.g.
>>> ${1+$*} or ${unset_var-$*}) joins the PPs together into one field, as if
>>> either "$*" or the whole substitution were quoted.
>>>
>>> POSIX says the unquoted substitution is supposed to generate one field
>>> for each positional parameter, with further field splitting inactive due
>>> to empty IFS.
>
> If you want the expansion to be aware of the value of IFS and whether or
> field splitting will take place as a result, and I think that's the intent
> of the example, then the part of the description of $* that details what
> will happen when field splitting does not take place is active. That's
> where it describes joining the positional parameters into a single string.
It might also be the case that, as I think I said in my original reply (?),
field splitting is just not one of the expansions that is performed on the
`word' in a ${paramOPword} expansion, and that is what determines the
expansion of $*.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/
- [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields, Martijn Dekker, 2017/02/18
- Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields, Chet Ramey, 2017/02/19
- Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields, Grisha Levit, 2017/02/24
- Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields, Chet Ramey, 2017/02/24
- Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields,
Chet Ramey <=
- Re: [BUG] With null IFS, ${1+$*}, ${var-$*}, etc. don't generate fields, Martijn Dekker, 2017/02/27