Anyone got a idea how to install the trace command on RHEL5 to monitor variable access? I already googled it and search via yum but nothing seems to work.
2 Answers
The command you link to is a built in TCL command. Do you have TCL installed?
yum install tcl
Edit: Try the following program:
proc tellme {id a e op} {
puts " $id a=$a e=$e op=$op\
ax=[info exists ::$a] ex=[info exists ::${a}($e)]"
}
proc do {args} {
puts "<$args>"
uplevel $args
}
trace var a wu {tellme array}
trace var a(1) wu {tellme element}
puts [trace vinfo a]
puts [trace vinfo a(1)]
do set a(0) zero
do set a(1) one
do set a(2) two
do unset a(0)
do unset a(2)
do unset a
# output is:
#
# {wu {tellme array}}
# {wu {tellme element}}
# <set a(0) zero>
# array a=a e=0 op=w ax=1 ex=1
# <set a(1) one>
# array a=a e=1 op=w ax=1 ex=1
# element a=a e=1 op=w ax=1 ex=1
# <set a(2) two>
# array a=a e=2 op=w ax=1 ex=1
# <unset a(0)>
# array a=a e=0 op=u ax=1 ex=0
# <unset a(2)>
# array a=a e=2 op=u ax=1 ex=0
# <unset a>
# array a=a e= op=u ax=0 ex=0
# element a=a e=1 op=u ax=0 ex=0
(From http://wiki.tcl.tk/1505 )
-
yes, installed it, but it didn't include the trace command for an unknown reason. Mar 14, 2010 at 13:14
You may be getting your UNIXes mixed up ... on Linux the command strace
performs a system trace - that may be what you're looking for. Try a yum install strace
Alternatively you may be looking for traceroute
to perform a network trace. Install that with a yum install traceroute