On 4/30/17 11:23 AM, omasmotorrad wrote:
> Why is it that one cannot change the delimiter for the
> words generated during brace expansion?

Because they are separate words that are expanded individually, not
a single word that undergoes word splitting.  They end up being
separate arguments to, e.g., `echo'.

The words appear to be space-separated here because `echo' separates
its arguments with spaces on output (as it has done since time
immemorial).

> 
> On stackexchange, there too are questions
> regarding this. Personally I’d like to be able to write
> $ IFS=„,“ echo a{b,c,d}
> rather than
> $ echo a{b,c,d} | tr „ „ „,“

If I were going to do it, I'd use a shell function:

separate_with_commas()
{
        local IFS=','
        echo "$*"
}

separate_with_commas a{b,c,d}

The general problem you're trying to solve is basically how to turn
multiple words into a single string, so maybe solve that more directly.

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

Reply via email to