Thread (2 messages) flat view 2 messages, 2 authors, 2019-01-03

Re: [PATCH] test-lib: check Bash version for '-x' without using shell arrays

From: Junio C Hamano <hidden>
Date: 2019-01-02 16:46:50

Possibly related (same subject, not in this thread)

Johannes Sixt [off-list ref] writes:
Would it perhaps be simpler to just hide the syntax behind eval? Like

 		if test -z "$test_untraceable" || {
 		     test -n "$BASH_VERSION" && eval '
		       test ${BASH_VERSINFO[0]} -gt 4 || {
			 test ${BASH_VERSINFO[0]} -eq 4 &&
			 test ${BASH_VERSINFO[1]} -ge 1
		       }
 		     '
It indeed is somewhat easier to see that your version does exactly
the same as the original than the posted patch, but the pattern
substitutions are not all that bad, either.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help