From: Monson S. <js...@re...> - 2013-11-25 06:48:00
|
Valuable $errmesg wasn't initialized at beginning, when bash option "nounset" is set, statement like errmesg="$errmesg XXXXXX" will cause bash unbound variable error. Furthermore, $errmesg will be echoed every time it is assigned, so there is no need for accumulated assignment. Signed-off-by: Monson Shao <js...@re...> --- testcases/kernel/containers/netns/runnetnstest.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testcases/kernel/containers/netns/runnetnstest.sh b/testcases/kernel/containers/netns/runnetnstest.sh index fb494a2..f7bf80f 100755 --- a/testcases/kernel/containers/netns/runnetnstest.sh +++ b/testcases/kernel/containers/netns/runnetnstest.sh @@ -60,7 +60,7 @@ two_children_ns rc=$? if [ $rc -ne 0 ]; then exit_code=$rc - errmesg="$errmesg two_children_ns: return code is $exit_code ; " + errmesg="two_children_ns: return code is $exit_code ; " echo $errmesg else echo "two_children_ns: PASS" @@ -71,7 +71,7 @@ crtchild_delchild rc=$? if [ $rc -ne 0 ]; then exit_code=$rc - errmesg="$errmesg crtchild_delchild: return code is $exit_code ; " + errmesg="crtchild_delchild: return code is $exit_code ; " echo $errmesg else echo "crtchild_delchild: PASS" @@ -83,7 +83,7 @@ par_chld_ipv6 rc=$? if [ $rc -ne 0 ]; then exit_code=$rc - errmesg="$errmesg par_chld_ipv6: return code is $exit_code ; " + errmesg="par_chld_ipv6: return code is $exit_code ; " echo $errmesg else echo "par_chld_ipv6: PASS" @@ -99,7 +99,7 @@ echo #rc=$? #if [ $rc -ne 0 ]; then # exit_code=$rc -# errmesg="$errmesg sysfsview: return code is $exit_code ; " +# errmesg="sysfsview: return code is $exit_code ; " # echo $errmesg #else # echo "sysfsview: PASS" @@ -119,7 +119,7 @@ par_chld_ftp rc=$? if [ $rc -ne 0 ]; then exit_code=$rc - errmesg="$errmesg par_chld_ftp: FAIL $exit_code ; " + errmesg="par_chld_ftp: FAIL $exit_code ; " echo $errmesg else echo "par_chld_ftp: PASS" -- 1.8.3.1 |