From: Sooraj S on 23 Jun 2010 03:47 Hi, I am verynew to expect scripting. I want to pass a command from a perl script to my expect script. Expect script should simpy execute that command. But "cmd" in expect script is seen with a value "abc" instead of the original value. Pls help me so sample code : ----------------------- my_perl.pl --------------- ..... $command = "abc -option1 op1 -option2 op2" system("./my_expect"); ..... my_expect --------------- set cmd [lindex $argv 0] puts "cmd"
From: Uwe Klein on 23 Jun 2010 03:59 Sooraj S wrote: > Hi, > > I am verynew to expect scripting. I want to pass a command from a perl > script to my expect script. Expect script should simpy execute that > command. But "cmd" in expect script is seen with a value "abc" instead > of the original value. Pls help me so > > sample code : > ----------------------- > my_perl.pl > --------------- > .... > $command = "abc -option1 op1 -option2 op2" > system("./my_expect"); > .... > > > my_expect > --------------- > set cmd [lindex $argv 0] > puts "cmd" Looks like that mechanism in perl tokenizes $command test with: foreach arg $argv { puts arg:$arg } if you want to spawn that command: --tcl8.4: if 1 [ linsert $argv 0 spawn ] tcl8.5++: spawn {*}$argv uwe
From: Sooraj S on 23 Jun 2010 05:11 Thanks for your reply.But I'm not tokenising the command. I want to send the command as such from my perl script. Is it possible to accept it in my expect script? ----- $command = "abc -option1 op1 -option2 op2" system("./my_expect $command"); ----
From: Uwe Klein on 23 Jun 2010 05:48 Sooraj S wrote: > Thanks for your reply.But I'm not tokenising the command. I want to > send the command as such from my perl script. Is it possible to accept > it in my expect script? > > ----- > $command = "abc -option1 op1 -option2 op2" > system("./my_expect $command"); > ---- no idea, I'm not a perlite ;-) what about system("./my_expect \"$command\""); just a guess. uwe
From: Sooraj S on 23 Jun 2010 07:00 Thanks Klein....that worked :-)
|
Next
|
Last
Pages: 1 2 Prev: Expect/TCL Configuration Issue - Form POST submit not working Next: ANN: DiffUtil |