I'm writing a program which reads changes STDIN to a text file, forks and execs the commads in there. It works and execs the commands but I'm struggling to find how to recognise the end of the file. I have tried running this in a while (!EOF) loop but i'm not really sure if this is right and if so around which bits it should exist. Should it just be around the exec segment or should it be around the entire program?
I'd really appreciate some guidance