Hi
I see the following behaviour for the piece of code given below:
:
:
set def_router_cmd {def_router=`route -n | grep ^0.0.0.0|awk '{print \$2}'`}
set pingcmd {ping -c 3 $def_router}
send "$def_router_cmd\r"
send "$pingcmd \r"
puts "The output is '$expect_out(buffer)'."
#interact
Now...
I wanted to set variables with a command to be executed on server.
is it possible something like below?
set def_router_cmd 'def_router=`route -n | grep ^0.0.0.0|awk '{print $2}'`'
set ping_cmd="ping -c 3 $def_router"
send $def_router_cmd\r
send $ping_cmd\r
tcl is interpreting $ which is...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.