A me non risulta proprio!
max@studio:~> ps ax | grep -w xxx | grep -v grep
max@studio:~> echo $?
1
max@studio:~> ps ax | grep -w init | grep -v grep > /dev/null
max@studio:~> echo $?
0
#include <stdlib.h>
#include <stdio.h>
int main ()
{
int ret[2];
ret[0]=system("ps ax | grep -w init | grep -v grep > /dev/null");
ret[1]=system("ps ax | grep -w xxxxxxx | grep -v grep > /dev/null");
printf ("ret[0]=%d\nret[1]=%d\n",ret[0],ret[1]);
return 0;
}
max@studio:~> ./a.out
ret[0]=0
ret[1]=256
max@studio:~>