Expect 中设置变量跟 Bash 稍有不同

Bash

1
2
name=wxnacy
echo $name # wxnacy

Expect

1
2
set name wxnacy
puts $name # wxnacy

边境变量也是如此

Bash

1
echo $HOME      # /Users/wxnacy

Expect

1
puts $env(HOME) # /Users/wxnacy
03-16 13:46