From: Minh Diep Date: Fri, 23 Mar 2012 01:06:06 +0000 (-0700) Subject: LU-1254 iokit: should not use single '[]' X-Git-Tag: 2.2.51~9 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=369f9a5c41e35f63787c2c0f077df5f44048c87f LU-1254 iokit: should not use single '[]' Single [] checking for empty variable is dangerous. When the variable is undefined, it will fall through without double quote Signed-off-by: Minh Diep Change-Id: Iec49cd704be8d106cce07032dc20f060f6044e8a Reviewed-on: http://review.whamcloud.com/2373 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Wei Liu Reviewed-by: Yu Jian Reviewed-by: Oleg Drokin --- diff --git a/lustre-iokit/obdfilter-survey/libecho b/lustre-iokit/obdfilter-survey/libecho index c34d9c8..9a4e8c4 100644 --- a/lustre-iokit/obdfilter-survey/libecho +++ b/lustre-iokit/obdfilter-survey/libecho @@ -217,7 +217,7 @@ cleanup () { shift for ((i = 0; i < $ndevs; i++)); do host=${host_names[$i]} - if [ -n ${do_teardown_ec[$i]} ]; then + if [[ -n "${do_teardown_ec[$i]}" ]]; then teardown_ec_devno $host ${client_names[$i]} fi done