Thread (88 messages) 88 messages, 4 authors, 2017-03-15

Re: [PATCH 03/18] lib-submodule-update: teach test_submodule_content the -C <dir> flag

From: Eric Wong <hidden>
Date: 2017-03-02 02:36:25

Possibly related (same subject, not in this thread)

Stefan Beller [off-list ref] wrote:
 test_submodule_content () {
+	if test "$1" == "-C"
Use a single '=' for portability in sh.  It's also a good idea
to prefix variables with 'x' or some such, since "$1" could be
"-n" or some other supported switch for test(1).
So, something like:

	if test x"$1" = "x-C"

...or use a case statement.

On Debian systems, I use the "checkbashisms" from the
"devscripts" package to find and avoid bash dependencies.

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