#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main(int argc, char* argv[])
{
    int n=atoi(argv[1]);
    int i;
    char str[10], *res;
    int x;
    if(fork())
    {
        exit(0);
    }
    for(i=1; i<=n; i++)
    {
         FILE *fd=fopen("/home/me/Desktop/pipe","r");
        if(n<=0)
        {
            exit(0);
        }
        else

                printf("x: %d.\n", n);
                system("ps -e -o pid,ppid,comm | grep uppgift1");

            sleep(15);
            exit(0);
        }
    }


