yes, as I told I am not in position to add echo statments but there do exists a echo statment and data echoed is perfectly visible in log.
After tht echo call only the C executable is invoker with appropiate arguments.
Why i am worried with this pieve of code specifically is we have two functioncalls sortTempInputFile and sortInputFile.
First call "sortInputFile" is always successfull while second call where only filename is different fails "sortTempInputFile"
before invoking the sort command we even check the error code.
complete code of function is:
void sortTempInputFile(char *inputFileName)
{
char sortcmd [1024] = "\0";
char tmpSortFileName [1024] = "\0";
iFileName[0] = '\0';
if(errno)
{
perror(" ");
}
sprintf(tmpSortFileName, "/tmp/temp%s", "tempIRBPAVAInputFile");
/* Sort by carrier ID, company #, bill to RAO, statement date, BTN, ??? */
sprintf(sortcmd,
"sort -k 1.132,1.135 -k 1.118,1.119 -k 1.118,1.119 "\
"-k 1.112,1.114 -k 1.104,1.111 -k 1.142,1.151 "\
"-k 1.155,1.162 %s > %s", inputFileName, tmpSortFileName);
system(sortcmd);
if(errno)
{
fprintf(stderr,
"Error sorting the input file %s...\nExiting...\n",
inputFileName);
exit(ERR);
}
sprintf(sortcmd, "chmod 777 %s", tmpSortFileName);
system(sortcmd);
if(errno)
{
fprintf(stderr,"%s%s\n",
"Error changing permissions for the temp input file ...",
"Exiting...");
exit(ERR);
}
sprintf(sortcmd, "mv -f %s %s", tmpSortFileName, inputFileName);
system(sortcmd);
if(errno)
{
fprintf(stderr,"Error moving the input file ...\nExiting...\n");
exit(ERR);
}
}
I greped for tty in all the scripts but could not find one...is there anyway we will be connecting to tty?