#!/bin/sh

if test '!' -r cjkvi-j.eids
then
  exit 77
fi

cp cjkvi-j.eids gbv-d-$$.eids
echo '.foo.,.x.⿱止月.y.⿱止月' >> gbv-d-$$.eids
./idsgrep -G --bitvec-debug gbv-d-$$.eids > gbv-d-$$.bvec 2> /dev/null
./idsgrep -I '!&!⿱止?!⿱?月' gbv-d-$$.eids > gbv-outa.$$
./idsgrep --bitvec-debug '|⿱止?⿱?月' gbv-d-$$.eids \
  | grep -v 'Garbage' > gbv-outb.$$
sleep 3
touch gbv-d-$$.eids
./idsgrep '!&!⿱止?!⿱?月' gbv-d-$$.eids >> gbv-outa.$$
./idsgrep -I '!&!⿱止?!⿱?月' gbv-d-$$.eids >> gbv-outb.$$

if diff gbv-outa.$$ gbv-outb.$$
then
  rm -f gbv-d-$$.eids gbv-d-$$.bvec gbv-outa.$$ gbv-outb.$$
  exit 0
else
  rm -f gbv-d-$$.eids gbv-d-$$.bvec gbv-outa.$$ gbv-outb.$$
  exit 1
fi
