Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

My file like this with some number or id


this my url


now by using this url get the response from url and download output of the url. not the code.

example take the url and add the min = file id number at end of the url.


this url hit the server get the response of the url ouput below

 404000847307897|-101| Requested MIN not found.

finally this output store in one file.

can you do this curl with awk or wget?

share|improve this question

2 Answers 2

I can't comment yet to ask for more details on your question so I'll guess : you have a file containing a list of numbers, you want to query an URL using each of these numbers as parameters and store the results in one file.

Using wget in a shell script :



for param in $(cat "$PARAMETER_FILE")
  wget "${URL}${param}" >> "$OUTPUT_FILE"
share|improve this answer
it is possible run in gnuwin32. how to run this? i am new to shell script? please tell me @ louis carrese – ganik Jul 31 '13 at 5:17
I did not know about gnuwin32, but I guess you could if you installed the wget package. However, you might have to do it with a .bat script so the "for" loop would not be the same. If you have to do this in Windows, I suggest you try installing Cygwin. It will allow you to run true shell scripts. – Louis Carrese Jul 31 '13 at 11:06

Assuming the list of file IDs is in a file called file_ids.txt.

for i in $(cat file_ids.txt); do 
   curl$i -O -s >> output.txt;

The above will create a bunch of commands like this:

curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt
curl -O -s >> output.txt

The above loops through the list of file IDs and runs the curl command appending the output from the HTTP GET to the file output.txt. The operator >> takes the output from the curl commands and appends it to the file.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.