home *** CD-ROM | disk | FTP | other *** search
Korn shell script | 1997-05-01 | 1.5 KB | 74 lines |
- #!/bin/ksh -p
-
- PRG=`whence $0` >/dev/null 2>&1
- BINDIR=`dirname $PRG`
- CFPHOME=`dirname $BINDIR`
-
- OSJCFPJAVA=${OSJCFPJAVA-java}
-
- # The shell variable acpath is assumed to be set to the name of directory
- # or filename. Convert acpath to refer to a canonical name.
- convertacpath()
- {
- if test -d $acpath
- then
- thisdir=`pwd`
- cd $acpath
- acpath=`/bin/pwd`
- cd $thisdir
- fi
- }
-
- # Convert a ':' delimited classpath list to canonical form. The
- # shell variable cpath is assumed to contain the class path to convert.
- # Upon return, cpath refers to an updated class path
- convertcpath()
- {
- # We need to add a ':' at the end so that ksh parameter substitution works
- tmpcpath=$cpath:
- cpath=""
- while [ "$tmpcpath" != "" ];do
- # acpath is everything up to but not including the next ':'
- acpath=${tmpcpath%%:*}
- # tmpcpath is everything after the next ':'
- tmpcpath=${tmpcpath#*:}
- convertacpath
- if [ "$cpath" != "" ] ; then
- cpath=$cpath:$acpath
- else
- cpath=$acpath
- fi
- done
- }
-
- # By default, don't canonicalize
- canonical=0
- javaargs=
- args=
- while [ "$1" != "" ];do
- case "$1" in
- -canonical) canonical=1
- shift
- ;;
- -cpath | -classpath | -d | -dest) args="$args $1"
- shift
- cpath=$1
- shift
- if [ $canonical = 1 ]; then
- convertcpath
- fi
- args="$args $cpath"
- ;;
- *) args="$args $1";shift 1 ;;
- esac
- done
-
- if [ $canonical = 1 ]; then
- cpath=$CLASSPATH
- convertcpath
- CLASSPATH=$cpath
- fi
-
- $OSJCFPJAVA $javaargs COM.odi.filter.OSCFP $args
-
-