How to make the command inside this for loop execute?
#!/bin/bash
for i in {8..12}
do
printf "curl \"http://myurl?hour=20140131%02s\" -o file%02s.txt\n" "$i" "$i"
done
the current version of my script prints out the following lines:
curl "http://myurl?hour=2014013108" -o file08.txt
curl "http://myurl?hour=2014013109" -o file09.txt
curl "http://myurl?hour=2014013110" -o file10.txt
curl "http://myurl?hour=2014013111" -o file11.txt
curl "http://myurl?hour=2014013112" -o file12.txt
I'd like to change the script so that each line is executed and a file is saved at each curl request.
printfand the double-quotes.