Chris Down pointed that out. My loop now looks like this -- portable (I
believe) and fast:

BashCount() {
    for (( i = $1 ; i > 0 ; i-- )); do
        :
    done
    echo Just did $1 iterations using bash math
}

-----Original Message-----
From: Linda Walsh [mailto:b...@tlinx.org] 
Sent: Sunday, March 17, 2013 8:36 PM
To: Bruce Dawson
Cc: 'Chris Down'; bug-bash@gnu.org; b...@packages.debian.org
Subject: Re: Bug/limitation in 'time'



Bruce Dawson wrote:
> Yep, we've changed our loops to use roughly that syntax. Unfortunately 
> a lot of online resources recommend the $(expr) technique. My 
> understanding is that using $(expr) is more portable, because i-- is 
> bash specific, but I don't really know.

but $((i-=1)) isn't Bash specific and does the same thing...


Reply via email to