Hi,

I did a search on this forum and on google but I'm not able to find what I'm looking for!

When you're on a unix shell and want to look the number of occurance of the word "all" that are in a text, you'll do (one way to do it) :

# cat myfile | grep all | wc -w

* maybe the syntax is wrong but that's not the point *

Now let's assume I'm programming 'wc' in C or C++ (both are ok).
What I've found on google is 'popen' but it needs "cat myfile | grep all" as argument nb 1.

How do I do to get this from the shell ?
Maybe I'm thinking of it the wrong way.

Any help would be appreciated!

Regards

-tux