C-Linux-Any way to pass command "history" to Linux shell? -
i'm writing c program run in linux system. program pass linux commands shell , receive result txt files.
system("last >> last.txt"); system("ls -s >>ls.txt");
but failed "history" told me not command buildin.
so there way can pass "history" other ones?
thanks!
you might able invoke built-in command using shell:
system("bash -e \"history >> history.txt\"");
change "bash"
preferred shell.
Comments
Post a Comment