152 |
for {set i 0} {$i < [llength $args]} {incr i} { |
for {set i 0} {$i < [llength $args]} {incr i} { |
153 |
set opt [lindex $args $i] |
set opt [lindex $args $i] |
154 |
if {"$opt" == "-retcode"} { |
if {"$opt" == "-retcode"} { |
|
set retcode [lindex $args [expr $i + 1]] |
|
155 |
incr i |
incr i |
156 |
|
set retcode [lindex $args $i] |
157 |
|
verbose "RETCODE $retcode" 1 |
158 |
} elseif {"$opt" == "-message"} { |
} elseif {"$opt" == "-message"} { |
159 |
set message [lindex $args [expr $i + 1]] |
set message [lindex $args [expr $i + 1]] |
160 |
incr i |
incr i |
198 |
|
|
199 |
set res [remote_exec host $cmd] |
set res [remote_exec host $cmd] |
200 |
|
|
201 |
set args [concat $args "$retcode"] |
lappend args "$retcode" |
202 |
|
|
203 |
set output [lindex $res 1] |
set output [lindex $res 1] |
204 |
|
|
227 |
|
|
228 |
if {$regexp} { |
if {$regexp} { |
229 |
verbose "does \"$output\" match regular expression \"$pattern\"?" 1 |
verbose "does \"$output\" match regular expression \"$pattern\"?" 1 |
230 |
if {![regexp -- "$pattern(.*)" "$output" dummy output]} { |
if {![regexp -- "${pattern}(.*)" "$output" dummy output]} { |
231 |
set result 1 |
set result 1 |
232 |
} |
} |
233 |
} else { |
} else { |
238 |
} |
} |
239 |
set output [string range $output [string length $pattern] end] |
set output [string range $output [string length $pattern] end] |
240 |
} |
} |
241 |
if {![regexp -- "\[ \t]*\r\n(.*)" "$output" dummy output]} { |
} |
242 |
set result 1 |
|
243 |
} |
if {![regexp -- "\[ \t]*\r\n(.*)" "$output" dummy output]} { |
244 |
|
set result 1 |
245 |
} |
} |
246 |
|
|
247 |
if {$result} { |
if {$result} { |