I have count = read(pipe, buffer, buffsize); and am trying to run what is received (buffer) through another executable to have a differing process done on it.
printf("%s", buffer); prints it out correctly, but running it through execl("/path", "/path", buffer, NULL); or a number of other ways I've tried doesn't seem to run the executable. path is a compiled executable.
The executable does run properly if I use execv("./path", STDIN_FILENO);, but that isn't being taken from the pipe. path is expecting a the string as standard input.
The situation of the program is that I'm typing in input on one program using a while loop and read(), using a pipe to send that text to the program that is running execl (nothing else needs to be done in this program), that is then trying to call the executable with the string as an stdin. Only the intended input is coming in through the pipe, in chunks when the user presses enter.
An example of a string coming through the pipe is this is an example. The executable needs to have this inputted as standard input.
How can I get the string to be used as standard input for /path executable correctly?
execlin a child process or the original process? Is there anything else coming in on that pipe, or is it entirely the intended input for the second executable? Does the program that's doing all this have other stuff that it needs to do?count?1