I am a new Linux C programmer and i`m not sure how to use the "system" command in a C script. For example: I am usign the rrdtool program to create some graphics and I have to write the next command at shell prompt.
"rrdtool update test.rrd 920804700:12345" ok?
now, i want to use this sentence in a C script, then i write:
system("rrdtool update test.rrd 920804700:12345")
the "920804700" and "12345" numbers are stored in a file and I already know how to retrieve them and assign to the char variables "a" and "b". I want to know how can i relate these numbers with the system command?
i`m thinking of something like this:
system("rrdtool update test.rrd "%s",":"%s" , a , b) ... is this right?
Can anyone help me out?