Operating System - HP-UX
1757402 Members
3312 Online
108860 Solutions
New Discussion юеВ

Re: Background processes result code in HP-UX

 
SOLVED
Go to solution

Re: Background processes result code in HP-UX

Just to add to the confusion... a word of warning on using "wait " in scripts...

if the command you are intending to wait for *exits* before you call wait, you will *not* get the return code of the process... so for shortlived processes, I tend not to trust wait, and always put some sort of shell wrapper around any background process where I can collect status information (into a file for example)

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Horia Chirculescu
Honored Contributor

Re: Background processes result code in HP-UX

Thank you all for the replys.

I will close this thread as it it clear now.

Best regards,
Horia Chirculescu
Vianet Serv SRL.
Best regards from Romania,
Horia.
Horia Chirculescu
Honored Contributor

Re: Background processes result code in HP-UX

Thread closed.
Best regards from Romania,
Horia.
Dennis Handly
Acclaimed Contributor

Re: Background processes result code in HP-UX

>JRF: I have always found the shell's use of '-eq', '-lt' and '-gt' ..., to be counterintuitive.

If you are only doing numeric comparisons, then you can switch to C style:
if (( rc1 != 0 || rc2 != 0 || rc3 != 0 || rc4 != 0 || rc5 != 0 )); then

Or if you think these are boolean values:
if (( rc1 || rc2 || rc3 || rc4 || rc5 )); then