it is possible to send bash commands into a c application right?
for example if i wanted to do a "wget http://example.com" inside a c application how would this be done?
Printable View
it is possible to send bash commands into a c application right?
for example if i wanted to do a "wget http://example.com" inside a c application how would this be done?
Lookup popen()
I tried this
but got an error ofCode:#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
popen("wget http://google.com", "w");
}
sh: wget: command not found
im using mac and have installed wget and can use it via console, any ideas?
Use the full path to wget? Run "which wget" in the console to find it.
ah, thank you that worked
i installed via fink and it put it in a different dir not /usr/bin/wget as usual
----
i tried this to get the location inside the c program
popen("/usr/bin/which wget","w");
however get no response, any ideas?
--
never mind its just due to some messed up dirs on my mac lol