linux shell

拼接java运行命令:

BASE_DIR=`pwd`

LIB_DIR=/lib/

echo $LIB_DIR

RESULT=`ls $BASE_DIR$LIB_DIR|grep .jar|awk '{print "'$BASE_DIR''$LIB_DIR'"$0}'|tr "\n" ":"`

echo $RESULT

java -cp $RESULT:./ com.noriental.redis.RedisCurd

拼接java运行命令:

BASE_DIR=`pwd`
RESULT=`ls ./|grep .jar|awk '{print "'$BASE_DIR'/"$0}'|tr "\n" ":"`

echo $RESULT
java -cp $RESULT:./ Hello

字符串截取:

export TEST="hello"

echo ${TEST:0:2}

后台运行程序

nohup java -jar /home/devp/appserver/resin-4.0.15/lib/resin.jar console > /home/devp/log/temp.log 2>&1 &

相关推荐