cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to use an external file as an input file for config file?

From: Abhijit Gadkari <abhijit.gadkari_at_gmail.com>
Date: Tue, 15 Mar 2005 19:16:42 -0800

Challange : How to use an external file as an input file for config file?

Process Algorithm is

1. login using the credential provided by config.txt
2. pick up the record from input.txt , and store them in local
variables in config.txt
3. based on the process flow, pass on these variables to web server
4. capture the reply and store it in file
5. go back to step 2
6. If not at the end of input.txt , pick up the next record and
continue. If end of input.txt , go to step 7
7.Logout from web server

Explanation

Config file will set up the connection with web server and pass on the
variables one by one based on the url of the pages. At the end of the
process , config file will dump the output in html format and loop
back to the step 2 to select the next record from input.txt, keeping
the same connection open. This process will continue till all the
records from input.txt are processed. One can do this in one shot
using different curl switches, but how to do this in loop using an
external input file? [i.e. step no 2.]

At present, my curl command looks like

E:>Curl>Curl –-config config.txt

This works fine. At present the config file can handle step no 1,3,4,7
as explained in the algorithm. So the challenge is in linking an
external input file with config file. [i.e. calling the records one by
one from some other text file like input.txt from config.txt].

Do I have to write a C code ?

I am wondering if there is any other simple, more robust solution possible.
Received on 2005-03-16