I'm very new to tcl/expect and I'm looking for a push in the right direction on this issue. I'm writing an expect script to log into a router and push a file that varies. I was thinking of using something like a case structure in shell scripting:
Code: Select all
echo -n "What file would you like to push? Press 1 for file1, 2 for file2 or 3 for both: "; read file
case $file in
1) [i]expect and send commands for file1[/i] ;;
2) [i]expect and send commands for file2[/i];;
3) etc...
esac
Thanks for any guidance you can provide.