diff options
Diffstat (limited to 'bin/clogin')
-rwxr-xr-x | bin/clogin | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -136,6 +136,17 @@ for {set i 0} {$i < $argc} {incr i} { -T* { incr i set timeout [ lindex $argv $i ] + } -x* - + -X { + if {! [ regexp .\[xX\](.+) $arg ignore cmd_file]} { + incr i + set cmd_file [ lindex $argv $i ] + } + set cmd_fd [open $cmd_file r] + set cmd_text [read $cmd_fd] + close $cmd_fd + set command [join [split $cmd_text \n] \;] + set do_command 1 # Do we enable? } -noenable { set enable 0 @@ -345,7 +356,7 @@ proc run_commands { prompt command } { set num_commands [llength $commands] for {set i 0} {$i < $num_commands} { incr i} { - send "[lindex $commands $i]\r" + send "[subst [lindex $commands $i]]\r" expect { -re "^\[^\n\r]*$prompt." { exp_continue } -re "^\[^\n\r *]*$prompt" {} @@ -353,7 +364,7 @@ proc run_commands { prompt command } { } } } else { - send "$command\r" + send "[subst $command]\r" expect { -re "^\[^\n\r]*$prompt." { exp_continue } -re "^\[^\n\r *]*$prompt" {} |