bug-bash
[Top][All Lists]
Advanced

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

Re: bug? {1..3} doesnt' use IFS to separate fields


From: Linda Walsh
Subject: Re: bug? {1..3} doesnt' use IFS to separate fields
Date: Sun, 07 Aug 2011 13:32:56 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666

Geir Hauge wrote:
2011/7/25 Linda Walsh <address@hidden>
I know it wasn't designed this way, but it seems like it
is a bug.
The manual says nothing about brace expansion using IFS in any way, so it's
not a bug.
----
        I didn't say the manual said that.

        However, in expanding arrays you have the option where it does use the 
IFS:

If the word is double-quoted, ${name[*]} expands to a single word with the value of each array member separated by the first character of the IFS special variable, and address@hidden expands each element of name to a sep‐
       arate word.

So it does say something about 'some patterns' inside brace expansion using IFS in
this way.

So if I say <<<$(echo "${word{1..3}[*]}" ), it might be reasonable syntax to support
such?  I.e. for IFS=/, => "word1/word2/word3"

It would seem appropriate though redundant to have
<<<"$(echo "address@hidden" ) would expand the same as "word{1..3}"
i.e. word1 word2 work3,



I don't see the usefulness in having brace expansion's behavior changed by
IFS.
---
        Do you see any usefulness in having it for array expansion?




reply via email to

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