I have problem with saving the execvp output.I want to save the output of (ps -eo pid,fname,state,ppid,gid,sid) in txt file .
This is my code :
#include <unistd.h>
int main(void)
{
char* args[]={"ps","-eo","pid,fname,state,ppid,gid,sid" , ">" , "t.txt"};
execvp(args[0],args);
return 0;
}
But when i run it .It doesnt work .