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
10 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
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
2. Shell Programming and Scripting
ksh $ETL_XXX/bin/filename.ksh wf_workflowname .
Which is used in post session command. (2 Replies)
Discussion started by: dummy_needhelp
2 Replies
3. UNIX for Dummies Questions & Answers
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
4. UNIX for Dummies Questions & Answers
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
5. Shell Programming and Scripting
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
6. UNIX for Dummies Questions & Answers
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
7. Shell Programming and Scripting
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
8. Solaris
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
9. Shell Programming and Scripting
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
10. UNIX for Beginners Questions & Answers
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
MTRACE(1) Linux user manual MTRACE(1)
NAME
mtrace - interpret the malloc trace log
SYNOPSIS
mtrace [option]... [binary] mtracedata
DESCRIPTION
mtrace is a Perl script used to interpret and provide human readable output of the trace log contained in the file mtracedata, whose con-
tents were produced by mtrace(3). If binary is provided, the output of mtrace also contains the source file name with line number informa-
tion for problem locations (assuming that binary was compiled with debugging information).
For more information about the mtrace(3) function and mtrace script usage, see mtrace(3).
OPTIONS
--help Print help and exit.
--version
Print version information and exit.
BUGS
For bug reporting instructions, please see: <http://www.gnu.org/software/libc/bugs.html>.
SEE ALSO
memusage(1), mtrace(3)
COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the
latest version of this page, can be found at https://www.kernel.org/doc/man-pages/.
GNU
2017-09-15 MTRACE(1)