Matthew_S <[EMAIL PROTECTED]> writes:

> Sorry guys, I need to take it a step further and am hitting a wall at the
> moment;
>
> I need to take two results (from you examples), compare them and get a final
> result.  What I have thus far is;
>
> operation()
> {
> echo >> $LOG
>         echo Running operation>> $LOG
>         for i in a b 
>         do
>                 mkdir $DIR/dir$i
>                 cd $DIR/dir$i
>                 date1=$SECONDS
>                 operation
>                 date2=$SECONDS
>                 interval$i=$(($date2 - $date1)) #1st & 2nd errors

If you want to set a computed variable you need to use eval.

                  eval interval$i='$(($date2 - $date1))'

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to