In RHEL6.5GA and RHEL7.0GA, running run_memctl_test.sh outputs "/opt/ltp/testcases/bin/run_memctl_test.sh: line 87: [: -lt: unary operator expected" error. This is because $MEM_AVAIL is empty here, which is caused by command "tr -s [:space:]" that loses efficacy. Using "awk" replaces the former intercept method.
Signed-off-by: Xing Gu <gux.f...@cn.fujitsu.com> --- testcases/kernel/controllers/memctl/run_memctl_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/controllers/memctl/run_memctl_test.sh b/testcases/kernel/controllers/memctl/run_memctl_test.sh index 66e8f4f..fe171df 100755 --- a/testcases/kernel/controllers/memctl/run_memctl_test.sh +++ b/testcases/kernel/controllers/memctl/run_memctl_test.sh @@ -83,7 +83,7 @@ cd $LTPROOT/testcases/bin/ ################################################################################# # First of all check if the system has sufficient memory -MEM_AVAIL=`cat /proc/meminfo | grep MemTotal | tr -s [:space:] | cut -d" " -f2`; +MEM_AVAIL=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`; if [ $MEM_AVAIL -lt 262144 ] # 256MB(as test requires some ~200MB) then echo System does not have sufficient free memory.; -- 1.9.3 ------------------------------------------------------------------------------ Infragistics Professional Build stunning WinForms apps today! Reboot your WinForms applications with our WinForms controls. Build a bridge from your legacy apps to the future. http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list