#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <signal.h>

int main()
{
	FILE *fp;
	int state;
	char buff[256];

	fp = popen("ps aux | grep new_sh_statusd | awk '{print $2}'", "r");
	if (fp == NULL)
	{
		perror("erro : ");
		exit(0);
	}
	
	while (fgets(buff, 256, fp) != NULL)
	{
		fprintf(stderr, "%s", buff);
	}

	state = pclose(fp);
	fprintf(stderr, "state is %d\n", state);

	exit(0);
}
