How to call awk or sed from inside a c program


How can I call awk or sed inside a c program? I know I could use exec(), but I don't want to deal with fork() and all that other nastiness.

Best Solution

Would popen work? It spawns the process, then you read/write with a FILE* handle