imthekrish Respected Contributor.
Respected Contributor.

Return code SSH SHELL operation

I get return code 0 for both

echo $PATH and


shouldnt i get non zero retiurn code for second command ?

1 Reply
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Return code SSH SHELL operation

The behavior seems to match the code in behind.

I checked it on the open source cloudslang content available for you to check too here - 

as long as the exit code is greater than 0 (in your case I quess it will be 127) the return code will be 0

        if (commandResult.getExitCode() >= 0) {
            returnResult.put(OutputNames.RETURN_RESULT, commandResult.getStandardOutput());
            returnResult.put(OutputNames.RETURN_CODE, ReturnCodes.SUCCESS);
        } else {
            returnResult.put(OutputNames.RETURN_RESULT, commandResult.getStandardError());
            returnResult.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE);

If you are looking for a changed behavior I suggest to open a ticket according to the process so that the request will be properly prioritized and considered.

Hope it helps,

Andrei Vasile Truta
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.