[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <149933231171.8910.8211757029671617912.stgit@devbox>
Date: Thu, 6 Jul 2017 18:12:02 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: linux-kselftest@...r.kernel.org, shuah@...nel.org,
Steven Rostedt <rostedt@...dmis.org>
Cc: mhiramat@...nel.org, Ingo Molnar <mingo@...hat.com>,
linux-kernel@...r.kernel.org, naresh.kamboju@...aro.org
Subject: [PATCH v3 5/5] selftests: ftrace: Check given string is not zero-length
Use [ ! -z "$VAR" ] instead of [ "$VAR" ] to check
whether the given string variable is not zero-length
since it obviously shows what it means.
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
tools/testing/selftests/ftrace/ftracetest | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 453f73d..aab3d5e 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -8,7 +8,7 @@
# Released under the terms of the GPL v2.
usage() { # errno [message]
-[ "$2" ] && echo $2
+[ ! -z "$2" ] && echo $2
echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
echo " Options:"
echo " -h|--help Show help message"
@@ -50,7 +50,7 @@ parse_opts() { # opts
local OPT_TEST_CASES=
local OPT_TEST_DIR=
- while [ "$1" ]; do
+ while [ ! -z "$1" ]; do
case "$1" in
--help|-h)
usage 0
@@ -96,7 +96,7 @@ parse_opts() { # opts
;;
esac
done
- if [ "$OPT_TEST_CASES" ]; then
+ if [ ! -z "$OPT_TEST_CASES" ]; then
TEST_CASES=$OPT_TEST_CASES
fi
}
Powered by blists - more mailing lists