Are you using the log for anything?  You can simply not log and not
worry about all the extra characters, and have Expect look for regular
values you see on the screen.  E.g.

send "03"
expect "LOCATION"
send "="
expect "LOCATION ="
send -h "ares\r"

We are using Expect & perl to create  new materials lists off of our III
system and output to the web - see

Would be happy to share scripts, with the caveat that I'm NOT a
programmer, and there are most likely more elegant ways to do things
than I have!

Kenneth R. Irwin wrote:

> Hi folks,
> I just started tinkering with Expect to talk to our OPAC, and I'm finding
> that when I look at the resulting log files I get a lot of garbage
> characters eg:
> [H[2J[1;11H*** INNOPAC
> (for more see log: )
> I see these characters in more, emacs, web browsers, etc. But
> curiously, I
> don't see them in "grep" results (although I do see them if I pipe grep
> results to a logfile of their own.) This makes me think that the computer
> knows they are funny characters in some way, which gives me some hope
> that
> they are filterable.
> Can anyone suggest a way to do this? I'm working on HP-UX (though soon
> it'll be Solaris. soon soon soon!)
> And if anyone already has experience using Expect to talk to their OPAC,
> especially Innopac, I'd love to hear about it. Looks like it could have
> some complexities, and I don't really want to reinvent the wheel if the
> wheel already exists.
> Thanks,
> Ken
> Ken Irwin
> [log in to unmask]
> Reference/Electronic Resources Librarian        (937) 327-7594
> Thomas Library, Wittenberg University