Re: [htdig] another setup issue


Subject: Re: [htdig] another setup issue
From: Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Date: Wed Aug 02 2000 - 08:16:08 PDT


According to Dan Amarel:
> Geoff Hutchison wrote:
> >
> > At 7:52 PM -0400 8/1/00, Dan Amarel wrote:
> > >though I hadn't changed anything on the example rundig
> > >script besides the path to COMMONDIR.
> >
> > So let's get this straight. It was working OK before and then you
> > changed the path and now it's not?
>
> No, I've only run it with the changed COMMONDIR path, i.e.
>
> 'COMMONDIR=/home/httpd/html/htdig'
>
> changed to
>
> 'COMMONDIR=/usr/local/apache-tom3.1/htdocs/htdig'.
> >
> > Can we see the modified script?
> Sure, I'll attach it.
...
> #!/bin/sh
>
> #
> # rundig
> #
> # $Id: rundig,v 1.7 1999/01/31 04:27:02 ghutchis Exp $
> #
> # This is a sample script to create a search database for ht://Dig.
> #
> DBDIR=/var/lib/htdig
>
>
> # WAS: COMMONDIR=/home/httpd/html/htdig
> COMMONDIR=/usr/local/apache-tom3.1/htdocs/htdig
...
> if [ "`ls -t $COMMONDIR/english.0 $COMMONDIR/word2root.db 2>/dev/null | sed 1q`" = \
> "$COMMONDIR/english.0" ]
> then
> cat <<EOF
> Warning:
> The following is a lengthly process, but it is run only
> the first time you start ht://Dig. Initializing database...
> EOF
> $BINDIR/htfuzzy $opts endings
> fi
>
> if [ "`ls -t $COMMONDIR/synonyms $COMMONDIR/synonyms.db 2>/dev/null | sed 1q`" = \
> "$COMMONDIR/synonyms" ]
> then
> cat <<EOF
> Warning:
> The following is a lengthly process, but it is run only
> the first time you start ht://Dig. Initializing database...
> EOF
> $BINDIR/htfuzzy $opts synonyms
> fi
>
> /usr/bin/htfuzzy $verbose metaphone
> /usr/bin/htfuzzy $verbose soundex

Well, you obviously changed more than just the COMMONDIR setting. The
warning messages above are not part of the original script, and therein
lies the problem. Your here-documents are not terminated properly.
When you use the "<<EOF" construct to begin a here-document, the ending
"EOF" tag must be at the very start of the line. You should remove the
leading space. If I recall, you can also use something like "<<-EOF" to
allow leading space before the ending tag, but then I think all leading
space is stripped from the here-document, so you'd lose all indentation.

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------ To unsubscribe from the htdig mailing list, send a message to htdig-unsubscribe@htdig.org You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Tue Aug 01 2000 - 22:15:13 PDT