First of all, Code:
#!/usr/bin/ksh
typeset -i NO_RECS
$NO_RECS=process_file
Will not print the return code. The syntax is wrong to begin with, it should be
Code:
NO_RECS=$(process_file)
The second thing is that the return code of any command executed in the shell is not printed, but stored in a variable $?. To directly get the value that your C program has, you should do it like this:
Code:
#!/usr/bin/ksh
typeset -i NO_RECS
NO_RECS=$(process_file)
And your C program should be:
Code:
int main(argc,argv)
int argc; char *argv[];
{
int no_recs_tot ;
/* This is just a function within the c program that returns the int value */
no_recs_tot = bld_detail(v_out_path,v_in_path,inrec_cnt,v_src_data_dt);
fprintf(stdout,"%d",no_rec_tot);
} /* End main */
|