If grep fails to find a file it prints out an error message. Neither redirecting the output of grep
nor redirecting the output of the program
./code > "out.txt"
gets me a list of the files it can't find. Any suggestions on how to do that?
Code:
strcpy(grep, "grep \"");
strcat(grep, date2[d]);
strcat(grep, ",1552\" ");
strcat(grep, dir);
strcat(grep, &ratios[i*pagesize]);
strcat(grep, ".txt > \"out.txt\"");
corncob = popen(grep, "r");
fgets(buf,100,corncob);
pclose(corncob);
nor redirecting the output of the program
./code > "out.txt"
gets me a list of the files it can't find. Any suggestions on how to do that?