Linux: Use C to call a bash script

This is a discussion on Linux: Use C to call a bash script within the Linux Programming forums, part of the Platform Specific Boards category; How do i run a bash script from a c program? Or rather is it possible to have all the ...

>instead of system() one can use fork()-execv(). Better and more portable!
Do we have a sys call that does the "cut" or "grep" operations?
Portability is a big issue when it comes to using it, but I have somehow gotten into the habit of using it very often..

You don't have these system calls but instead you have a regex library. In my BSD system i have regex related functions. Use "man 3 -k regex" to list regex related manual pages.

You may not have those functions in Win32 environment. If you care about portability you can write your own "cut" or "grep" functions. They are not very difficult to implement (at least implementing cut and grep).

A word about regex. There are flavors - for example the difference between ksh & bash patterns, grep, egrep, and perl. The syntax of the regular expressions in those environments changes a lot. ... from least complex to most complex.

All this means is that the regex code you wrote may or may not support a regular expression you already have that works great -- elsewhere.