unix script exit status while calling informix program
Posted in 2006
Topics: General Discussion
Hi, Can anyone tell me why I get the different exit status for the following script execution while calling the informix program (/proj/prog.exe) : Note: the unix are all written in KORN shell. Unix Script A ----------------- ksh -c "/proj/prog.exe " 2>>/tmp/run.log 1>/tmp/error.log << ! ^M ! ret_code=$? Unix Script B ----------------- ksh -c "/proj/prog.exe " << ! ^M ! ret_code=$? Why am I getting different exit status (ret_code) from script A and script B? The correct return code should be from the program - prog.exe which is 100, but I am getting exit status as 1 in script A ? Why? I am suppose to use method script A but how to get the correct return code in the unix script in this case? -- Message posted via http://www.dbmonster.com
yy4 wrote: > Hi, > > Can anyone tell me why I get the different exit status for the following > script execution while calling the informix program (/proj/prog.exe) : > > Note: the unix are all written in KORN shell. As is good and proper. > > Unix Script A > ----------------- > ksh -c "/proj/prog.exe " 2>>/tmp/run.log 1>/tmp/error.log << ! Don't you mean: 1>/tmp/run.log 2>>/tmp/error.log ? If those files already exist, does your current user have sufficient permission? > ^M > ! > ret_code=$? > > Unix Script B > ----------------- > ksh -c "/proj/prog.exe " << ! > ^M > ! > ret_code=$? > > Why am I getting different exit status (ret_code) from script A and script B? > > The correct return code should be from the program - prog.exe which is 100, > but I am getting exit status as 1 in script A ? Why? > > I am suppose to use method script A but how to get the correct return code in > the unix script in this case? >