Thread (16 messages) flat view 16 messages, 3 authors, 2016-06-15

Re: [PATCH v2 3/3] git-submodule: New subcommand 'summary' (3) - limit summary size

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:19

"Ping Yin" [off-list ref] writes:
On Sat, Mar 1, 2008 at 3:29 PM, Junio C Hamano [off-list ref] wrote:

expr is portable?
It's not just portable but is a very old fashioned and time-proven way to
do things like this.
quoted
        if summary_limit=$(( $2 + 0 )) 2>/dev/null ||
           test "$2" != "$summary_limit"
        then
                usage
        fi
summary_limit=$(( $2 + 0 )) will always has return status 0
Ah, there's a typo there.  The intention was to reject non numbers

	for two in 43 -32 'deadbeef' ' -27' HEAD ''
        do
		if sl=$(( $two + 0 )) 2>/dev/null && test "$two" == "$sl"
                then
                	echo Ah, "$two", that is a number.
		else
                	echo You gave me an un-number "'$two' (vs '$sl')".
		fi
	done
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help