MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/md/property_graph/pgx/bin/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/md/property_graph/pgx/bin/pgx

#!/bin/bash

set -e

canFail() {
  set +e
    $@
  set -e
}

red=`canFail tput setafsd 1`
orange=`canFail tput setaf 3`
bold=`canFail tput bold`
normal=`canFail tput sgr0`

warn() { echo -e "${orange}[WARNING]${normal} $1" 1>&2; }
error() { echo -e "${red}[ERROR]${normal} $1" 1>&2; }

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # handle symlinks
  DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
CP="$DIR/../../lib/*:$DIR/../../dal/groovy/*:$DIR/../conf"

# add hadoop dependencies to classpath, if available
if [[ -z "$HADOOP_HOME" ]] && [[ -z "$HADOOP_CONF_DIR" ]]; then
	warn "neither HADOOP_HOME nor HADOOP_CONF_DIR is set. If loading/storing from/to HDFS, Hadoop default configuration values will be used."
else 
	if [[ -z "$HADOOP_CONF_DIR" ]]; then
		# Cloudera's default
		HADOOP_CONF_DIR="$HADOOP_HOME/etc/hadoop"
	fi
	# add hadoop configuration to classpath
	CP="$CP:$HADOOP_CONF_DIR"
fi


if [[ -n "$OPG_CLASSPATH" ]]; then
	warn "OPG_CLASSPATH environment will be prepended to PGX classpath. If this is not intended, do 'unset OPG_CLASSPATH' and restart."
	CP="$OPG_CLASSPATH:$CP"
fi

if [[ -z "$JAVA_HOME" ]]; then
    JAVA="java "
else
    JAVA="$JAVA_HOME/bin/java "
fi

$JAVA $JAVA_OPTS -cp "$CP" oracle.pgx.shell.Console "$@"

# Return the program's exit code
exit $?

OHA YOOOO