![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Logins command exit status is 236 not 0
I have noticed that on version 11.23 I get exit status 236 from the
following command: logins -oxl root ; echo $? > 236 However on 11.31 I get the expected code 0 logins -oxl root ; echo $? > 0 The output is correct for both versions and contains no error data. Can anyone explain this ? Its causing problems with some automation we are using which calls the logins command and check the exit status. ---------- Post updated 26-11-09 at 12:01 PM ---------- Previous update was 25-11-09 at 03:47 PM ---------- Update: Further investigation as revealed this is hardware dependent. IA64 with 11.23 OK exit code 0 IA64 with 11.31 OK exit code 0 RISC with 11.23 FAIL exit code 236 ****** IA64 with 11.31 OK exit code 0 RISC with 11.23 OK exit code 0 We still do not know why this is happening, still would love some feedback if you can explain this.. |
|
|||
|
the wait() system call returns the lowest 8 bits of the actual return code.
It is treated as if it were an "unsigned char" in effect. It is not. So, negative small numbers returned become return values > 127, for example. Think ~(return value), we saw this on migrating from 11.0 to HPUX 11.23 PA_RISC-2 boxes, running 32 bit mode code. The 11.0 code is binary compatible, so we did not recompile. Create a hashed alias in /etc/profile: a shell script wrapper for logins. It masks the return value to zero or 1. We ran into other commands that do this as well. |
|
|||
|
Thanks that was very useful information. To round this off is there any HP formal documents describing this as working as designed ? or would a defect be an acceptable path.
Though the described work around is fine for me on the command line. We have discovered that the 3rd party software hangs with the workaround in place. So its likely the 3rd party needs to adjust the application or HP would need to return correct exit codes i.e '0' for success. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| command does not return exit status due to tee | anand_bh | Shell Programming and Scripting | 2 | 12-05-2008 12:20 PM |
| Move Command and exit status problem | visingha | Shell Programming and Scripting | 10 | 09-13-2008 09:08 PM |
| Move Command and exit status problem | visingha | UNIX for Dummies Questions & Answers | 1 | 09-12-2008 03:14 AM |
| exit status of command in a pipe line | topcat8 | UNIX for Dummies Questions & Answers | 10 | 10-19-2007 05:39 AM |
| Getting the exit status of a remote command | zoonalex | Shell Programming and Scripting | 1 | 08-23-2006 05:58 PM |