I want to run execlp() from C file and write the result to some output file. I use the line:
buff = "./cgi-bin/smth";
execlp(buff, buff, "> /cgi-bin/tmp", NULL);
where smth is a compiled c script. But smth prints to stdout, and no file appears. What happens, and how to put script result to an output file?