Chinaunix
标题:
请教下大家这个SHELL的意思
[打印本页]
作者:
BHLA2016
时间:
2016-01-05 18:16
标题:
请教下大家这个SHELL的意思
CONFIG_FILE=config/jdbc
ENV_FILE=bin/setDomainEnv.sh
_PARAM_=(-Dweblogic.threadpool.MinPoolSize= \
-Dweblogic.threadpool.MaxPoolSize= \
-Dfile.encoding= \
-Djava.awt.headless= \
jdbc-data-source \
jdbc-driver-params \
jdbc-connection-pool-params \
initial-capacity \
max-capacity \
capacity-increment \
JAVA_OPTIONS=\
)
_TMP_ARG=
findEnvArg(){
if [ ! -s "${ENV_FILE}" ] ; then
echo "==ERROR
{ENV_FILE#*/} not exists!"
exit 1
fi
_TMP_ARG=
if flag=`grep -v "#" "$ENV_FILE"| grep "$1"| grep "${_PARAM_[8]}"`; then
value=`echo $flag|awk '{print substr($flag,index($flag,"'"${1:1}"'"
+length("'"${1:1}"'"
)}'`
value="${value//\"/ }"
arr=($value)
_TMP_ARG="${arr[0]}"
fi
}
作者:
hgfg1645
时间:
2016-01-05 22:57
这么炫,是配置Java数据库的脚本吧
作者:
Shell_HAT
时间:
2016-01-06 08:29
这是一段WebLogic相关的脚本,熟悉WebLogic的人很容易看懂。
CONFIG_FILE=config/jdbc
# 设置环境变量的脚本
ENV_FILE=bin/setDomainEnv.sh
# 定义一个数组,里面包含了常用了WebLogic参数
_PARAM_=(-Dweblogic.threadpool.MinPoolSize= \
-Dweblogic.threadpool.MaxPoolSize= \
-Dfile.encoding= \
-Djava.awt.headless= \
jdbc-data-source \
jdbc-driver-params \
jdbc-connection-pool-params \
initial-capacity \
max-capacity \
capacity-increment \
JAVA_OPTIONS=\
)
_TMP_ARG=
# 调用这个函数的时候会传递一个位置参数进来,根据它对max-capacity做些处理赋值给变量_TMP_ARG
findEnvArg(){
if [ ! -s "${ENV_FILE}" ] ; then
echo "==ERROR:${ENV_FILE#*/} not exists!"
exit 1
fi
_TMP_ARG=
if flag=`grep -v "#" "$ENV_FILE"| grep "$1"| grep "${_PARAM_[8]}"`; then
value=`echo $flag|awk '{print substr($flag,index($flag,"'"${1:1}"'")+length("'"${1:1}"'"))}'`
value="${value//\"/ }"
arr=($value)
_TMP_ARG="${arr[0]}"
fi
}
复制代码
作者:
BHLA2016
时间:
2016-01-06 14:32
知道了 感谢大家的热心解答
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2