sivga wrote:
> hello all iam new to expect this is my program does
>
> set PING "ping"
>
> proc newpingDev { newipAddr } {
> global PING PING_TIMEOUT
>
> exp_send -- "$PING $newipAddr\r"
> # spawn ping $newipAddr\r
> while (1) {
> expect {
> "*bytes from * time*" {
>
> return "SUCCESS"
> }
> "*is alive*" {
>
> return "SUCCESS"
> }
> "*Destination Host Unreachable*" {
>
> return "FAILED"
> }
> "*Network is unreachable*" {
> return "FAILED"
> }
> "*no answer from*" {
> return "FAILED"
> }
> "unknown host" {
> return "FAILED"
> }
> "*Usage*" {
>
> return "FAILED"
> }
> timeout {
> return "FAILED"
> }
> }
> }
>
> }
>
>
> set newip "160.48.58.39"
> set devIp "1.1.1.1"
>
> set rval [eval newpingDev $devIp]
> puts " the return value from newiptest is $rval"
>
> if { $rval == "FAILED" } {
> set _rval [eval newpingDev $newip]
> puts " the return value from newiptest is $_rval"
>
> }
>
>
> the new ip is pingabble and devip is dummy ip so wheni i run the script
> with exp_send its says bothe are not pingable and returns failed where
> as when i spawn ping ipadrres in the function in ping the newip .i need
> to use send ..canu pls help ..this is a test progrma my real program is
> when the first ping failed to ping address then itshould ping then next
> one but when i use send thats not working
actullay what i sthe diff betweeen send and spawn why is it working if
use spawn for the second ip its working and not send ..thanks for the
help
Received on Tue Jan 17 14:53:41 2006