Skip to content

Instantly share code, notes, and snippets.

@betandr
Created February 27, 2019 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betandr/dc89eb8808d3beeddb7ea8c9d1fd1d14 to your computer and use it in GitHub Desktop.
Save betandr/dc89eb8808d3beeddb7ea8c9d1fd1d14 to your computer and use it in GitHub Desktop.
Generate curl requests containing floats
#!/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