[ List Archives Home ] [ Thread index for 2008 ]
[ Date index for 2008 ]
[ Author index for 2008 ]
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- Date: Tue, 27 Apr 2004 11:50:03 -0700
- From: Steven Moody <smoody@xxxxxxxxxx>
- Subject: Re: Conditionals in expect script for create lists
At 04:37 PM 4/26/2004 -0400, you wrote:
I've been using Expect scripts and Perl scripts to generate title lists
for my web site (and for other purposes) thanks to the kind folks at NOBLE
who put up the howto on their Swapshop. This works great except for (1)
when I can't predict whether the review file will be empty or not when I
start,
I base my scripts on the expectation the review file will be full - I use
an appropriate naming protocol to keep others from deleting it and my
script has built in the "overwrite this file" aspect of the process.
and (2) when I can't be sure that the query will produce a non-zero
number of records. Could somebody send me an example of how you handle
things like this?
I had that problem (it was a patron search) and created a dummy patron
record that filled the search criteria, so I would always get at least one hit.
More details: I have a report to find problems, which I would like to run
every night with no intervention necessary (using cron); often it will
find no records. If it gets zero results, I'd like to skip over all the
instructions for printing and have it continue on to the next part of the
report or to the end. Also, because it might leave the review file empty
or not empty, the next time it runs I'd like it to be able to deal with
either of these cases (currently the script expects that the file will not
be empty).
I have found examples of having the script send different things based on
what it receives from the server, but nothing about branching to a
different part of the script based on what it receives. Thanks for any
help you can give me.
I have looked into trying to embed conditional responses in expect and PERL
and never got very far, since my programming skills are intermediate at
best. I would also be interested if someone has tips or good sources on
programming conditonals in these languages.
Steven Moody
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Steven Moody smoody@xxxxxxxxxx
Library Systems Manager
http://library.jfku.edu
Robert M. Fisher Library phone: 925-969-3110
John F. Kennedy University
100 Ellinwood Way
Pleasant Hill CA 94523-4817