lib/Tools/changeparent
author wenzelm
Tue Apr 22 11:37:12 1997 +0200 (1997-04-22)
changeset 3007 e5efa177ee0c
parent 2334 00db792beb4e
permissions -rwxr-xr-x
removed -norc;
     1 #!/bin/bash
     2 #
     3 # $Id$
     4 #
     5 # DESCRIPTION: change parent of Poly/ML database
     6 
     7 
     8 PRG=$(basename $0)
     9 
    10 function usage()
    11 {
    12   echo
    13   echo "Usage: $PRG DB PARENT"
    14   echo
    15   echo "  Change parent of Poly/ML database DB to PARENT (full path name!)."
    16   echo
    17   exit 1
    18 }
    19 
    20 function fail()
    21 {
    22   echo "$1" >&2
    23   exit 2
    24 }
    25 
    26 
    27 ## main
    28 
    29 [ $# -ne 2 ] && usage
    30 
    31 DB="$1"
    32 PARENT="$2"
    33 
    34 case "$ML_SYSTEM" in
    35   polyml-*)
    36     [ ! -w "$DB" ] && fail "Database not writable: $DB"
    37     $ML_HOME/changeParent "$DB" "$PARENT"
    38     ;;
    39   *)
    40     fail "You're not set up for Poly/ML!"
    41     ;;
    42 esac