#!/bin/sh
# Filename : StockDispatch
# & nohub
# 思路: 遍历当前目录和$JAVA_HOME/lib下所有的jar文件, 加入-cp的环境变量 然后执行入口类
SETCOLOR_BOLD="echo -en \\033[1;32m"
SETCOLOR_NORMAL="echo -en \\033[0;39m"
CLASSPATH=""
CURRDIR="$(pwd)"
LIBDIR="$CURRDIR /usr/local/jdk1.5.0_02/lib"
tmpFile=./11
pidFile=./${0}pid
# find all jar library from current dir and CLASSPATH
find $LIBDIR -name "*.jar">$tmpFile
# add jar library to CLASSPATH
I=0
while read line
do
I=`expr $I + 1 `
if [ $I -eq 1 ]
then
CLASSPATH="${line}"
else
CLASSPATH="${CLASSPATH}:${line}"
fi
done< $tmpFile
rm $tmpFile
# run program
if [ "-$1" != "-" ]; then # if parameter 1 is not null
echo "java -cp .:${CLASSPATH} com.khan.AppMain.UpdateCell2CBC $1 > updatecell2cbc.log"
# java -cp .:${CLASSPATH} com.khan.AppMain.UpdateCell2CBC $1> updatecell2cbc.log
else
echo " usage: $0 CellListFile"
fi