[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Bug/limitation in 'time'
From: |
Bruce Dawson |
Subject: |
RE: Bug/limitation in 'time' |
Date: |
Sun, 17 Mar 2013 21:37:50 -0700 |
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:bash@tlinx.org]
Sent: Sunday, March 17, 2013 8:36 PM
To: Bruce Dawson
Cc: 'Chris Down'; bug-bash@gnu.org; bash@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...
- Bug/limitation in 'time', Bruce Dawson, 2013/03/16
- Re: Bug/limitation in 'time', Chris Down, 2013/03/16
- RE: Bug/limitation in 'time', Bruce Dawson, 2013/03/17
- Re: Bug/limitation in 'time', Chris Down, 2013/03/17
- Re: Bug/limitation in 'time', Linda Walsh, 2013/03/17
- RE: Bug/limitation in 'time',
Bruce Dawson <=
- RE: Bug/limitation in 'time', Chris F.A. Johnson, 2013/03/18
- Re: Bug/limitation in 'time', Jonathan Nieder, 2013/03/18
- Re: Bug/limitation in 'time', Linda Walsh, 2013/03/18
- Re: Bug/limitation in 'time', Chris Down, 2013/03/18
- Re: Bug/limitation in 'time', Linda Walsh, 2013/03/18
Re: Bug/limitation in 'time', Chris F.A. Johnson, 2013/03/17