Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Shell script cleanups/style changes?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:25

David Kastrup [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help