lib/Tools/changeparent
author wenzelm
Thu, 06 Feb 1997 18:22:59 +0100
changeset 2589 9d910f3681d0
parent 2334 00db792beb4e
child 3007 e5efa177ee0c
permissions -rwxr-xr-x
now falls back on ucat instead of cat;

#!/bin/bash -norc
#
# $Id$
#
# DESCRIPTION: change parent of Poly/ML database


PRG=$(basename $0)

function usage()
{
  echo
  echo "Usage: $PRG DB PARENT"
  echo
  echo "  Change parent of Poly/ML database DB to PARENT (full path name!)."
  echo
  exit 1
}

function fail()
{
  echo "$1" >&2
  exit 2
}


## main

[ $# -ne 2 ] && usage

DB="$1"
PARENT="$2"

case "$ML_SYSTEM" in
  polyml-*)
    [ ! -w "$DB" ] && fail "Database not writable: $DB"
    $ML_HOME/changeParent "$DB" "$PARENT"
    ;;
  *)
    fail "You're not set up for Poly/ML!"
    ;;
esac