I want to pass a variable number of arguments to a expect script:
#!/usr/bin/expectset timeout 10spawn ssh -o "StrictHostKeyChecking no" [lindex $argv 0]@[lindex $argv 2]expect "password: "send "[lindex $argv 1]\n"expect "$ "for {set i 1} {$i < [llength $argv]} {incr i 1} { send { echo $i }}
I want to get
123
But instead I get
echo $iecho $i