expect - How to automate console scenario using TCL script? -
i want automate next scenario:
login router give reload when reloading router, press esp key continuously. when pressing esp key , boot> prompt come. execute commands in this.i can above things manually, using "teraterm" , console. how within tcl script.
please help me this.
thanks, balu p.
you first need find interactive console programme can issue commands from. may find plink.exe putty suite suitable. scheme telnet.exe not suitable, has special flag set on prevents automation, , teraterm isn't suitable because gui programme far can see (gui programme automation very hard least, , don't want if there's easier way).
once can task interactively, plug within of expect script. it's straight forward.
startspawn, making programme run , passing in arguments required connect other system. interact remote system. listen suitable prompt expect. (remember, might include prompts send username , password!) tell send. remember \r how send return. when you're done, close. of course, things more complex when you're dealing conditionals, error conditions , timeouts; expect can handle those, code bit more complex. inquire question 1 time you've got concrete problem can help with.
tcl expect
No comments:
Post a Comment