I'm writing a C program to run in Linux shell. Now I got a problem with such command.
#include <stdio.h>
void main()
{
char* command="history>>history";
system(command);
}
I want it to write the result of command "history" into a document, but it failed with a blank one.
If I change it to "date>>history", current system time will be written into the document.
Is there any problem with "history>>history"? What should I do if I want to get that work? Thanks!
which historyand observe that it is... probably a shell builtin