Re: return code wierdness
Posted in 1994
Are any of you Informix Gurus using the remote shell sometimes? I want to run a command on a remote machine, and get the return code back into my 4GL program. As Jack Parker didn't write: From 4gl: RUN command RETURNING retcode # command is "rsh cpu2 xyz.4ge.sh" on cpu2, xyz.4ge.sh contains: #!/bin/sh xyz.4ge echo $? > return_code Naturally, I am interested in both the value of "retcode" and "return_code". retcode will tell me if the rsh program ran ok. return_code, I thought, would tell me the exit status of xyz.4ge Just running xyz.4ge.sh on cpu2 writes the proper value into the return_code file. 0 if all went well, 1 if there was a problem. But, running "rsh cpu2 xyz.4ge.sh" from cpu1 always writes a "0" to return_code, regardless. The problem is not with Informix, it seems to be with rsh. I get the same problem if the shell script just calls "rm junk" then writes the exit code to return_code. On the local machine, no problem. Running the script via rsh, $? is always "0". This is on sun hardware, a sparc ipc and a sparc10, both running sunOS. Any thoughts? (Like, "wrong newsgroup!") -- Colin McGrath Internet: colin@scdipc0.ueci.com Raytheon Engineers & Constructors Inc. UUCP: ..!uunet!trac2000!trac3000!cmm 30 S. 17th St Voice: 215-422-3449 Philadelphia, PA, 19101 FAX: 215-422-4095 <Standard disclaimers apply>