Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 323265

Summary: zos shell does not display return value of previous command correctly
Product: [Tools] Target Management Reporter: Violaine Batthish <batthish>
Component: RSEAssignee: dsdp.tm.rse-inbox <tm.rse-inbox>
Status: NEW --- QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: normal    
Priority: P3 CC: ankitp, dmcknigh
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Violaine Batthish CLA 2010-08-20 11:42:08 EDT
Build Identifier: RSE Core 3.2 (20100607-1030), Eclipse RCP I20100608-0911

Reported by an RDz customer and reproduced.
When running a command in the z/OS UNIX shell, the user should be able to enter the following command to display the return value of the previous command
echo $?
However, in the shell, the return value is always 0, regardless of whether or not it should be.

As discussed with Dave McKnight:
1. Problem occurs with other shells (ie Linux)
2. Issue seems to be caused by the fact that the shell issues some echo commands to display the prompt - which removed the desired return code.
3. It might not be possible to get a fix in 3.2.1 timeframe, so the work around is to issue both commands at once:
     <command>; echo $?
4. Note that if ( ) are used with the work around from 3 in a z/os Unix shell,
     (<command>; echo $?) 
   then the shell appears to stop responding due to the same problem reported in bug 323262


Reproducible: Always

Steps to Reproduce:
1. Enter the following command in the shell:
    test a = b
2. Then enter the following command:
    echo $?

Expected result:
1

Actual result: 
0
Comment 1 Violaine Batthish CLA 2010-08-20 11:49:26 EDT
Forgot to mention that using rseterm does not produce the problem reported here, but use of rseterm is not acceptable to RDz.