Created
February 27, 2019 11:27
-
-
Save betandr/dc89eb8808d3beeddb7ea8c9d1fd1d14 to your computer and use it in GitHub Desktop.
Generate curl requests containing floats
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
count=1.414 | |
limit=1000 | |
while : ; | |
do | |
out=$(bc -l<<< "$count<$limit") | |
[[ $out == 0 ]] && { echo "done" ; exit 0; } | |
printf -v index "%020d" ${count//./} | |
printf -v url "http://localhost:8000?xmax=-1.444&xmin=-2.444&ymax=3&ymin=2&zoom=$count" | |
file=./pngs/$index.png | |
echo "requesting $file..." | |
curl $url > $file | |
count=$(bc<<< "scale=4; ($count*1.414)") | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment