Hello,
I have beeen googling for hours and havent found the answer I am looking for so I have come to experts. I hope you can help!
FILE * snapshot;
char mystring [100];
snapshot = popen("screen -x svr00001", "r");
pclose(snapshot );
if (snapshot == NULL) {
perror ("Not running");
} else {
fgets (mystring , 100 , snapshot);
puts (mystring);
}
However, this "streams" the data that the "screen" command is running how do I get it to "print" out the last line being executed by the program?
Thanks in advance!
I have beeen googling for hours and havent found the answer I am looking for so I have come to experts. I hope you can help!
FILE * snapshot;
char mystring [100];
snapshot = popen("screen -x svr00001", "r");
pclose(snapshot );
if (snapshot == NULL) {
perror ("Not running");
} else {
fgets (mystring , 100 , snapshot);
puts (mystring);
}
However, this "streams" the data that the "screen" command is running how do I get it to "print" out the last line being executed by the program?
Thanks in advance!
Comment