Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


rexx returns rc as -1 always

rexx returns rc as -1 always

rexx returns rc as -1 always


I have a rexx program that calls shell commands using "address cat filename".
This program returns rc as -1 when invoked from GI. But when the same rexx is invoked from linux command line rc is 0. The rc value is -1 irrespective of any shell command executed and called from GI right click. I doubt whether there will be any .profile that needs to be run in GI that is causing the issue. Please give your comments for the problem.

RE: rexx returns rc as -1 always

Which rexx interpreter are you using? Who supplies the 'cat' address space? What is 'GI'?


RE: rexx returns rc as -1 always

Of course, if 'cat' is the *nix concatenate command then your ADDRESS statement is coded wrongly - you have not provided the environment to which the command is to be sent. The syntax should be ADDRESS env command-string. However, if you are sending the command to the operating system you do not need to use the ADDRESS keyword - simply put the command string in quotes. Rexx recognises that it is not a Rexx construct so passes it on to the calling environment.

method 1
ADDRESS CMD "cat fiename"

method 2
"cat filename"

Read up on ADDRESS.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close