I want to know how can I do something like this in a C program.
if wget -q www.someurl.com;
then echo OK;
else echo Not there;
fi
I want to know how can I do something like this in a C program.
if wget -q www.someurl.com;
then echo OK;
else echo Not there;
fi
fork().exec*().SIGCHLD do wait(&status).WEXITSTATUS(status) to get the equivalent to r=$? from your script.I'd rather not do this through exec but through leveraging something like libcurl http://curl.haxx.se/libcurl/c/