This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: bash and real arithmetic
- From: Igor Pechtchanski <pechtcha at cs dot nyu dot edu>
- To: Stepan Yakovenko <yakovenko at ngs dot ru>
- Cc: cygwin at cygwin dot com
- Date: Fri, 11 Apr 2003 13:21:28 -0400 (EDT)
- Subject: Re: bash and real arithmetic
- Reply-to: cygwin at cygwin dot com
On Sat, 12 Apr 2003, Stepan Yakovenko wrote:
> HI!
>
> Is it possible to get for loops working
> in double arithmetic in bash ? I've got to run
> a program with a real argument many times, changing it
> every run by some fixed small (<1) number.
>
> Tanx in advance, sorry for my broken English.
Umm, scale? For example:
for (( i=0; i < 10; i++ )); do echo 0.$i; done
You could also try using something like awk for driving the loop:
awk 'BEGIN {for (i=0; i < 1; i+=0.1) system("echo " i)}' < /dev/null
Hope this helps,
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha at cs dot nyu dot edu
ZZZzz /,`.-'`' -. ;-;;,_ igor at watson dot ibm dot com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
Knowledge is an unending adventure at the edge of uncertainty.
-- Leto II
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/