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

Re: [PATCH 5/11] git-applypatch: Usage string clean-up, emit usage string at incorrect invocation

From: Fredrik Kuivinen <hidden>
Date: 2016-06-15 22:42:15

On Wed, Dec 14, 2005 at 02:45:42PM +0200, Timo Hirvonen wrote:
On Tue, 13 Dec 2005 21:20:57 -0800
Junio C Hamano [off-list ref] wrote:
quoted
freku045@student.liu.se writes:
quoted
 . git-sh-setup
 
+[[ "$#" = "3" || "$#" = "4" ]] || usage
+
I do not see much advantage to use [[...]] construct here.
[[ ]] is bashishm. Does not work with ash.


test $# -ge 3 && test $# -le 4 || usage

You don't need to quote $# because it is always defined (and always
non-negative integer).  You can't unset or set it.
Thanks. I guess this is what happens when you try to learn sh
programming from the bash manpage. :)

- Fredrik
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help