Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Meridian script

Status
Not open for further replies.

foleys

Technical User
Apr 16, 2003
33
US
I would like to run a script that logs into a meridain and captures the history file say every hour. I want to program a loop but the loop will stop once it sees the 100%

waitfor "VHST[HST] "
transmit "N"

I want this to keep on looping till

waitfor "100%"

Once this appears I want to the log out
transmit "****logo^M"

I hope this makes sense
 
Something like this may work for you:

proc main
when target 0 "100%" call alldone

while 1
waitfor "VHST[HST] "
transmit "N"
endwhile
endproc

proc alldone
transmit "****logo^M"
waitfor "prompt"
exit
endproc

This script will continually wait for "VHST[HST] " then send "N" whenever that string is received. One thing to keep in mind is that waitfor times out after 30 seconds, so the "N" would be sent regardless. You can either specify a timeout value at the end of the waitfor command, or use the FOREVER flag to make the waitfor command pause until the expected string is received.

When "****logo^M" is received, the alldone procedure is called and the logout command is sent. The waitfor command after that is looking for the prompt or string displayed after the logout is successful (you'll need to edit the string in the waitfor command), and then exit command will close the script.


aspect@aspectscripting.com
 
Thanks you very much

I will give this a try
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top