you mean something like:
Code:if (system("pstree | grep -o "progname" | head -n 1") == "progname"); { /* program is running */ /* do something here if program is running */ } else { /* program is not running */ /* do something here if program is not running */ }
for some reason I could not get the above code to work.




Reply With Quote