From: Junio C Hamano Date: Thu, 02 Aug 2007 21:21:01 GMT Subject: Re: Shell script cleanups/style changes? Message-ID: <7vsl71tyyq.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <85odhpzmbo.fsf@lola.goethe.zz> David Kastrup writes: > Sure. What about the git-rebase line using $(($end - $msgnum)) ? > That's even more risque than ##. Is it really risque? I do not think we have heard trouble with the arith expansion from anybody. A few mistakes in the past made that said things like: $((end - 1)) ;# wrong... say "$end" if you mean variable $((cd ...; pwd)) ;# wrong... say $( (...)) if command substitution # that involves subshell but I think we fixed them. > Understood. But using ${...#...} and ${...:+...} does not exactly > seem to be news in the git code base. Even though we have the claim > that Solaris' sh won't deal with the former. I do not think we have trouble with ${parameter#word}. Much less with ${parameter+word}; it has been in /bin/sh forever.