Logins command exit status is 236 not 0


 
Thread Tools Search this Thread
Operating Systems HP-UX Logins command exit status is 236 not 0
# 1  
Old 11-26-2009
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..
# 2  
Old 11-26-2009
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.
# 3  
Old 11-27-2009
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with finding the exit status of a 'nohup' command using 'PID'.

Hello All, I need to run a set of scripts, say 50 of them, parallely. I'm running these 50 scripts, from inside a script with the help of 'nohup' command. 1.The fifty scripts are stored in a separate file. 2.In a master script, i'm reading every line of the file through loop and executing... (4 Replies)
Discussion started by: SriRamKrish
4 Replies

2. Shell Programming and Scripting

Exit Status of Command

Hi All, I am doing an export and import (datapump) of 4 schema. I know we can do an export of 4 schema in one command. But just want to know how to check the exit status if i do the export/import of 4 schema in different commands in background. Please suggest. Thanks, Mani (1 Reply)
Discussion started by: pvmanikandan
1 Replies

3. UNIX for Dummies Questions & Answers

Exit Status Of Find Command

Hello All, I am trying to capture the exit status of find command and want to delete the files only when it is successful. But it is always returning me as success even if the pattern of that file doesn't exist in the current directory. please help, checked manual page but couldn't able to figure... (6 Replies)
Discussion started by: Ariean
6 Replies

4. UNIX for Advanced & Expert Users

Equivalents of tee command to find exit status of command

Hi, Want to log the output of command & check the exit status to find whether it succeeded or failed. > ls abc ls: abc: No such file or directory > echo $? 1 > ls abc 2>&1 | tee log ls: abc: No such file or directory > echo $? 0 Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies

5. Shell Programming and Scripting

Move Command and exit status problem

Hi All, I am using the following code to move files from one folder to another on the remote server: ssh username@server <<EOF cd source_dir find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir if then send mail indicating error otherwise echo "success" fi EOF ... (10 Replies)
Discussion started by: visingha
10 Replies

6. UNIX for Dummies Questions & Answers

Move Command and exit status problem

Hi All, I am using the following code to move files from one folder to another on the remote server: ssh username@server <<EOF cd source_dir find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir if then send mail indicating error otherwise echo "success" fi EOF ... (1 Reply)
Discussion started by: visingha
1 Replies

7. UNIX for Dummies Questions & Answers

exit status of command in a pipe line

Hi, I am trying to test the exit status of the cleartool lsvtree statement below, but it doesn't seem to be working due to the tail pipe, which it is testing instead. Is there a way around this without adding a tonne of new code? cleartool lsvtree $testlocation/$exe_name | tail -15 ... (10 Replies)
Discussion started by: topcat8
10 Replies

8. Shell Programming and Scripting

Getting the exit status of a remote command

Hi to everyone. How can I get the exit status from a remote command executed with rexec? :eek: machine A has RedHat Linux 9 and the remote machine B has SCO UNIX. Code: rexec -l user -p password host sh /u/files/scripts/seq_cal.sh 2006 08 I want the exit status returned by... (1 Reply)
Discussion started by: zoonalex
1 Replies

9. UNIX for Dummies Questions & Answers

how to find the exit status for the last executed command

I am executing a find command in my script i.e find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \; how do i check that this command is executed properly.. i would lke t trap the errror and display my error message kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies

10. Programming

How to find the exit status of last command in Unix?

Hi, I want to find the exit status of the last executed command in C Shell. Tried $? but getting the error Variable syntax...$? does not seem to work in C shell.. is there any other command in C shell to find the exit status of last command? Thanks in advance, raju (1 Reply)
Discussion started by: rajugp1
1 Replies
Login or Register to Ask a Question