# Common environment variables and settings.
#
# /usr/local/share/hyperestraier/filter must be included in
# the PATH if you're going to use external filters to extract keywords
# from any documents.

PATH=/usr/local/bin:/opt/sfw/bin:/bin:/sbin:/usr/sbin:/usr/bin
PATH=$PATH:/usr/local/share/hyperestraier/filter

LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/sfw/lib:/opt/sfw/lib
export PATH LD_LIBRARY_PATH
umask 022

# syslog tag and starting directory
cwd=`pwd`
b=`basename $cwd`
tag="`basename $0`-$b"
unset b

# search db to be created or updated
dbname=srch

# scratch file
tmp="temp$$"

# program name
case "$0" in
    /*) prog=$0 ;;
    *)  prog="$cwd/$0" ;;
esac

# die: prints an optional argument to stderr and exits.
#    A common use for "die" is with a test:
#         test -f /etc/passwd || die "no passwd file"
#    This works in subshells and loops, but may not exit with
#    a code other than 0.

die () {
    echo "$tag: error: $*" 1>&2
    exit 1
}

# logmsg: prints a message to the system log.
# expects variable "$tag" to hold the program basename.

logmsg () {
    logger -t $tag "$*"
}
