I am trying to reproduce in a C program what I can do in the console, in this case call the host command to sniff a site. My guess of why is not working is because maybe :host is not a system function" ? how can then be this achieved?
I do this at the console and it works
host -t txt harvard.edu
but if I try:
#include <stdio.h>
#include <stdlib.h>
#include<unistd.h>
int main()
{
system(``host -t txt google.com);
return 0;
}
then I get all errors. If I put the ticks, then it says "stray tick" and also will say host is not declared etc,if I remove them, then it just complains that host is not declared, so obviously system does not deal with host, but if the console does, then how can you do that from C?
thank you very much
Did you mean
system("host -t txt google.com");
You might need to specify the full path to host.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.