Equivalent of Rexx Interpret?


 
Thread Tools Search this Thread
Operating Systems AIX Equivalent of Rexx Interpret?
# 1  
Old 10-13-2005
Equivalent of Rexx Interpret?

Hi All,

Does anyone familiar with “Rexx interpret” know of a script equivalent?

For those that don't know “Rexx interpret”, here's how a script might look.

variable='echo Hello World!'
interpret $variable

Output is Hello World! because $variable was interpreted.

Thanks,

Lou
# 2  
Old 10-18-2005
Are you looking to learn shell scripting based on your knowledge of REXX? Or is this just a one liner you need translated?

variable='echo Hello World!'
interpret $variable
------------------------
The equivalent in ksh:
variable='Hello World!'
echo $variable

or

echo "Hello World"

If memory serves, there is a REXX interpreter for AIX, I don't know if it's a base package or a pay feature though.
# 3  
Old 10-18-2005
Hi Kawdes,

Thanks for checking out my post.

Your example is not quite what I want.

My variable contains the echo command itself, yours contains only "Hello World".

Yes, I'm learning scripting and I could use an interpret equivalent if there is one. Not trying to shoe-horn scripting into Rexx if that's what your question means.

Thanks,

Lou
# 4  
Old 10-18-2005
Oh, I see what you are wanting... I think...

REXX:
variable='echo Hello World!'
interpret $variable
--------------------------
In the ksh:
variable='echo Hello World!'
eval $variable

This will execute the contents of $variable instead of just displaying it.
# 5  
Old 10-18-2005
Exactly what I was looking for Kawdes, thanks!
# 6  
Old 10-19-2005
The "eval" is not necessary at all:

variable="print - 'hello world'"
$variable

will print "hello world".

ksh has a fixed order of the operations it undertakes before finally executing the result on the commandline. "eval" restarts this process and evaluates the already processed commandline a second time. It works (somehow) analogous to derefencing a pointer in C:

# var1="Willy"
# var2="Tony"
# selector='$var1'
# print - $selector
$var1
# eval print - $selector
Willy
# selector='$var2'
# print - $selector
$var1
# eval print - $selector
Tony

The reason is: The shell gets the command line "print - $selector" and evaluates that (by expanding the variable with its content) to "print - $var1". The process would normally stop there, but in case of using "eval" it would now again try to evaluate its own result and in this case (since "$var1" will expand to the content of var1) end up with "print - Willy".

I hope this clarifies things.

Btw. I remember there was a REXX interpreter for AIX 3.2.5 (yep, that's been awhile), maybe it is possible to still get it from IBM. I doubt that it will be available for other Unixes, though.

bakunin
# 7  
Old 09-19-2008
Talking REXX

All,

We are talking REXX, right? $ is not allowable in vars in REXX, so what are we talking?

Both "eval" and "interpret" work in REXX, but they have different formats, so you need to look in the manual for your version of REXX. There are several versions such as:

PREXX - Personal REXX
Regina - Another Personal REXX
OO-REXX - Official OO Rexx version (good docs)

Once you install you will enter "rexx cmdfile" at command line or for OO rexx enter the OO shell and execute the project. You can actually use OO rexx either way.

To display on screen, via command line, the "say" command, similar to PHP "echo" is used. Not eval or interpret.

Actually your script looks more like a PHP or PERL script than REXX. Is that what you are trying to do?

Let us know what else to help.

OMR
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Who -r interpret?

I booted into single user mode with /usr/sbin/reboot -- -s but after doing a control -d my who -r shows run-level 3 Nov 17 14:07 3 0 S I was expecting it to show run-level S why is this still in run level 3? thanks (1 Reply)
Discussion started by: goya
1 Replies

2. Shell Programming and Scripting

Debugging Web Page using REXX

I am taking over the responsibilties of maintaing a web page for the Mainframe Computer. This web page was designed using rexx. How can I debug this web page. I have tried using TRACE IR, but this does not work and displays the web page incorrectly. I want to be able to step through the web page... (3 Replies)
Discussion started by: Steve Carlson
3 Replies

3. Solaris

Regina Rexx 3.6 installation

1) Install below required pkg SUNWbtool, SUNWlibm, SUNWarc, SUNWhea and SUNWsprot SUNWsprox 2) Install GCC 3) Download Regina-REXX-3.6.tar Pkg for regina 4) tar -xvf Regina-REXX-3.6.tar 5) cd Regina-REXX-3.6 ./configure --build=sparc --enable-32bit --with-staticfunctions... (1 Reply)
Discussion started by: mahendra170
1 Replies

4. Shell Programming and Scripting

don't know how to interpret this

Can anyone tell me how to interpret this: listpage="ls |more" (the spaces are there in the example) $listpage It's from my bash book and I'm not sure what it means (3 Replies)
Discussion started by: Straitsfan
3 Replies

5. UNIX for Dummies Questions & Answers

How does Awk interpret $0!~

I know $0 is the entire file's contents (at least I think that is what it is!), but what exactly is: $0!~ This was a snippet from a larger line awk '$0!~/^$/ {print $0}' This deletes blank lines, but I want to know specifically the $0!~ part... I am guessing /^$/ is regex for blank line...... (5 Replies)
Discussion started by: glev2005
5 Replies

6. Shell Programming and Scripting

Can someone interpret this -- not sure

Was wondering if someone could interpret this for me -- I'm not sure what everything means. It's a shell script from my bash book: cd () { builtin cd "$@" es=$? echo "$OLDPWD ->$PWD" return $es } what I don't quite understand is the "$@". I think, if I understand... (6 Replies)
Discussion started by: Straitsfan
6 Replies

7. UNIX for Dummies Questions & Answers

How to interpret TOP

Hi, So I am new to Unix, and I need to check the performance of some apps I am running. But I don't know how to interpret the output from TOP. Could somebody please explain the difference between the different values. And also explain how I can have a process which has a %CPU > 100? ... (7 Replies)
Discussion started by: dj_jay_smith
7 Replies

8. UNIX for Dummies Questions & Answers

Please interpret.

Hi guys, I have no idea on unix but suddenly, my cobol programs calls a unix script that i know nothing about. can you guys interpret these lines for me? i know its a print command but I want to actually know how many copies it prints. qprt -da -P $1 -t '6' -i '6' -l '70' $2 qprt -da... (1 Reply)
Discussion started by: supacow
1 Replies

9. Shell Programming and Scripting

How Do We Interpret This ?

ksh $ETL_XXX/bin/filename.ksh wf_workflowname . Which is used in post session command. (2 Replies)
Discussion started by: dummy_needhelp
2 Replies

10. Post Here to Contact Site Administrators and Moderators

Unix Rexx

I am initiating a process from a mainframe using FTP. I'd like to use REXX statements in a CLIST to perform a capture of data from a UNIX system. Is there a "native" REXX language on UNIX. I've seen references for uni-REXX, OOREXX, S/REXX. Thanks, oldschool (1 Reply)
Discussion started by: oldschool
1 Replies
Login or Register to Ask a Question