File: loader_check.sh

package info (click to toggle)
ncbi-tools6 6.0.2-1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 33,932 kB
  • ctags: 50,922
  • sloc: ansic: 590,557; sh: 716; makefile: 375; csh: 234; lisp: 81; cpp: 57; perl: 48
file content (30 lines) | stat: -rw-r--r-- 518 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh
MMDB=$1
FNZ=$2
SUB=$3
if [ x$SUB = x ]; then
  [ -d mmdb ] && SUB=mmdb
fi

TMPF=/tmp/$$
FN=`basename $FNZ .gz`
echo "comparision ... \c"
if [ -f ${MMDB}${FNZ} ] ; then
  gzip -dc ${MMDB}${FNZ} >$TMPF
elif [ -f ${MMDB}${FN} ] ; then
  cat ${MMDB}${FN} >$TMPF
else
  echo "FAILED (${MMDB}${FN}* has not been found)  \c"
  exit
fi
if diff $SUB/${FN} $TMPF >$$ 2>/dev/null
then
  rm -f $SUB/${FN} $TMPF
  echo "ok \c"
else
  mv $TMPF $SUB/${FN}.orig
  cat $$
  cat $$ >>cmp_log
  echo "FAILED   \c"
fi
rm -f $$