bug-bash
[Top][All Lists]
Advanced

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

Word splitting and arithmetic expansion


From: Jan Schampera
Subject: Word splitting and arithmetic expansion
Date: Tue, 28 Dec 2010 20:50:41 +0100
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329)

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? Or was it just consistency for Korn, "everything is splitted, except the expansions where it makes no sense, like pathname expansion" - should I just take it "as is"? Or even older shells that split everything?

Neither the POSIX rationale nor older Korn or shell portability documents I found had any hint about the background - maybe you have?

--
Be conservative in what you do, be liberal in what you accept from others.
- jbp, master of the net, in RFC793




reply via email to

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