Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I call awk or sed from inside a c program?

Tags:

c

sed

awk

exec

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.

like image 726
samoz Avatar asked Mar 18 '09 15:03

samoz


1 Answers

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

like image 170
eduffy Avatar answered Oct 04 '22 03:10

eduffy