From: Linus Torvalds Date: Thu, 27 Oct 2005 15:12:19 GMT Subject: Re: [PATCH] Avoid using dc in git-count-objects Message-ID: In-Reply-To: On Thu, 27 Oct 2005, Matthias Urlichs wrote: > > It'll fork a subshell, but if the $() is a builtin, it won't exec. > > That being said, "echo $((1 + 2 + $((3 + 4))))" will not even fork. Right. Don't confuse $(..) with $((..)). They have absolutely nothing to do with each other, except for looking a bit similar. The $((..)) is shell-builtin arithmetic. I could imagine a broken shell forking and executing "dc" for it, but quite frankly, that sounds so unlikely as to be totally silly. So realistically, a shell either supports it or not. Oh - there's another similarity between $(..) and $((..)). They're both POSIX 1003.2 standard features, so any "modern" shell should support them. Although in practice I don't know if that means anything else than ksh (where both syntaxes came from, actually). Linus