I'm trying to do the following while loop using a bash script
file_size = 0 temp_size = 1 output_file while (file_size != temp_size) temp_size = file_size download file append to output_file if possible file_size = sizeof(output_file)
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.
It's unclear what exactly you are looking for, but I've taken a shot in hopes that this will help you.
The following program needs to be placed in a text file. Let's say you name it
You run it by passing in the output file name you are looking for.
It downloads the image file, at the url I hard coded in, over and over appending the output to the output file until the size of the output file is equal to or greater than the size that you specify in the
If you run it again with the same parameter, it will do nothing because the output file is already larger than the temp_size. You can reset it by giving it another file name, or removing the output file.