Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

expect script: variables holding commands?

Status
Not open for further replies.

madhavbhamidipati

Programmer
Jan 21, 2015
2
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 meant for remote bash and throwing errors, need help on this...

Or I need to get the output process it locally?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top