I can't get to have the variables in an expect loop written:
#!/bin/bash
expect -c "
set var1 10
puts {$var1}
puts $expect_out({$var1})
foreach name { bob jim jacobo henric } {
puts {hello $name $var1}
}"
my output is:
# ./test
({})
hello
hello
hello
hello
So basically it's not expanding any variable. Any idea?