Hi!
> @@ -130,17 +130,15 @@ check_result()
> cd $TCtmp
> for c_rhost in $HOSTS; do
> for c_ruser in $RUSERS; do
> - TOTAL_SUM=`rsh -n -l $c_ruser $c_rhost \
> - x=0; SUM=\$(sum -s $FILES|awk '{ print \$1 }')
> - for i in \$SUM; do
> - x=\$(( \$x + \$i ))
> + TOTAL_SUM=0
> + for i in $(rsh -n -l $c_ruser $c_rhost sum -s $FILES | awk '{
> print $1 }'); do
> + TOTAL_SUM=$(( $TOTAL_SUM + $i ))
> done
> - echo \$x`
> - if [ $TOTAL_SUM = $LSUM ]; then
> + if [ $TOTAL_SUM == $LSUM ]; then
Unlike C the correct comparsion operator here is the single '='. The
'==' is bash extension that does not work with other shells. And in case
you are comparing two numbers -eq is even better (as ' 0' -eq '0' is
still true unlike ' 0' = '0').
--
Cyril Hrubis
[email protected]
------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list