On Sat, Mar 1, 2008 at 3:29 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Ping Yin <pkufranky@xxxxxxxxx> writes: > > > + -n|--summary-limit) > > + if test -z "$2" || echo "$2" | grep --quiet -v '^-\?[0-9]\+$' > > \?\+????? > > summary_limit=$(expr "$2" : '[0-9][0-9]*$') > expr is portable? > or even > > 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 So i use summary_limit=$(($2 + 0)) if test $summary_limit = 0 -a "$2" != 0 then usage fi -- Ping Yin -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html