From: Simon Marchi Date: Tue, 2 Aug 2022 19:21:21 +0000 (-0400) Subject: tests: use -z / -n to test for string empty / non-empty X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;ds=sidebyside;h=75e396f6b20bdf52c76a3c7312e7fb815ac1e5e9;hp=75e396f6b20bdf52c76a3c7312e7fb815ac1e5e9;p=babeltrace.git tests: use -z / -n to test for string empty / non-empty shellcheck gives many warnings of this kind In env.sh.in line 44: if [ "x${BT_TESTS_CC_BIN:-}" = "x" ]; then ^---------------------^ SC2268 (style): Avoid x-prefix in comparisons as it no longer serves a purpose. Did you mean: if [ "${BT_TESTS_CC_BIN:-}" = "" ]; then Fix them by using test's -z and -n switches, which test for empty and non-empty strings, respectively. In some cases, we are checking for the string to have a specific value ( = "x1"), in which case I left the comparison, but just removed the leading x's. Change-Id: I3cd841d881916696419d540ed629e685d2edce9d Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/8635 Tested-by: jenkins ---