I have a list of names, that when you run the command line “sort< Names.txt | uniq | wc -l” gives a list of 23 unique names. mytask is to write a program to complete the same task however I amgetting 0 as my output and i’m not sure why. below is the list ofnames and my code
Names.txt —————-
Tony
Linda
Mark
Adam
Lewis
Zelda
Ben
Abe
Sally
Joey
Mark
David
William
Bill
David
Linda
Sue
Tom
Zelda
Alfred
Waldo
Loenard
Fred
Betty
Iris
Dana
Joey
Sally
George
Joey
Mark
David
William
Bill
David
Linda
Adam
Lewis
Zelda
Ben
Abe
Sally
Joey
Mark
David
William
Zelda
Ben
Abe
Sally
Joey
Mark
David
William
Bill
David
Linda
Sue
Tom
Zelda
Sally
George
Joey
Mark
David
William
code————————–
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <string.h>
int main(int argc, char *arv[])
{
int fd1[2]; //making file descriptor 1
int pid;
if (pipe(fd1) == -1)
{
fprintf(stderr, “fork error”);
return 1;
}
pid = fork();
//printf(“the pid for pipe parent is %d and the child pid is%d”, getppid(), getpid());
if (pid < 0)
{
fprintf(stderr, “fork
PayPal Gateway not configured
PayPal Gateway not configured