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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -