On 12/28/10 2:50 PM, Jan Schampera wrote:
> Hello list,
> 
> maybe something for old stagers.
> 
> Bash (and POSIX, and Korn, ...) do field/word splitting on the result of
> arithmetic expansions. This is fine, the behaviour per se is not a problem
> at all.
> 
> However, I wonder about the original thought behind it: Is there a specific
> reason or need to let the shell split an arithmetic expansion result?

Arithmetic expansion is a Posix invention.  It's treated just like every
other expansion: split unless double quoted.  There's no compelling
reason to make it behave differently.

> was it just consistency for Korn, "everything is splitted, except the
> expansions where it makes no sense, like pathname expansion"

Pathname expansion happens after word splitting.  Tilde expansion is the
one that's not subject to word splitting.

Chet
-- 
``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