tag:blogger.com,1999:blog-2807403883562053852.post4787277429485406699..comments2024-03-27T08:40:31.785-06:00Comments on Clayton Cramer.: bash questionClayton Cramerhttp://www.blogger.com/profile/03258083387204776812noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-2807403883562053852.post-62144218609264115832018-03-04T18:43:47.171-07:002018-03-04T18:43:47.171-07:00Awesome. They all work.Awesome. They all work.Clayton Cramerhttps://www.blogger.com/profile/03258083387204776812noreply@blogger.comtag:blogger.com,1999:blog-2807403883562053852.post-38706564511938203102018-03-04T17:33:55.291-07:002018-03-04T17:33:55.291-07:00Clayton:
Try this:
#! /bin/bash
for x in {0..100...Clayton:<br /><br />Try this:<br /><br />#! /bin/bash<br />for x in {0..100}<br />do<br />printf "%0.2f\n" $(bc -l <<EOF<br />0-$x/100<br />EOF<br />)<br />doneAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-2807403883562053852.post-47712190075148892622018-03-04T17:27:24.090-07:002018-03-04T17:27:24.090-07:00echo 'scale= 4; i = 0.00 ; while (i <= 1) {...echo 'scale= 4; i = 0.00 ; while (i <= 1) { print i, "\n"; i+=.01 }' | bc<br /><br />Or <br /><br />echo 'scale= 4; for ( i = 0.0; i<=1.0; i+=.01 ) { print i, "\n"}' | bc<br /><br />Billy Oblivionhttps://www.blogger.com/profile/16282343088921248885noreply@blogger.comtag:blogger.com,1999:blog-2807403883562053852.post-85674789833833392732018-03-04T16:29:58.406-07:002018-03-04T16:29:58.406-07:00how about just running "seq 0 -0.01 -1" ...how about just running "seq 0 -0.01 -1" ?<br /><br />this also gets the job done for me on freebsd, if you wanted to get some fancier arithmetic in there, later:<br /><br />#!/usr/local/bin/bash<br />bc << EOF<br />for(x=0.0; x>-1.0; x-=0.01) print x,"\n";<br />EOF<br />Jay Kominekhttps://www.blogger.com/profile/10329111965764211579noreply@blogger.com