Hi,
I trying to pass a variable to some unix commands and I'm not sure how to do it:
Example:
char *string_ptr;
char unix_cmd[200];
char unix_string1[]="echo ";
char unix_string1[]=" | cc=`grep -a \"ControlID\"| cut -c 375-378`";
main( ArsCSXitPrepExit *prep, char *argv[] )
{
int rc;
string_ptr=strcat(unix_cmd,unix_string1);
string_ptr=strcat(unix_cmd,argv[1]); <<<<< variable to pass
string_ptr=strcat(unix_cmd,unix_string2);
system(string_ptr);
I want the output to UNIX to look like:
echo $something | cc=`grep -a "ControlID" | cut -c 375-378`
Then I want $cc passed back to the C program.
Thanks.