Re: Shell script cleanups/style changes?
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 2, 2007, 21:21 UTC
- Message-ID
- <7vsl71tyyq.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <85odhpzmbo.fsf@lola.goethe.zz>
David Kastrup <dak@gnu.org> 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 subshellbut 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.