Shell中if判断语句

有if开始就要有fi结束标志。

#!/bin/sh
export LANG=zh_CN.utf8
export CLASSPATH=.:../bin:../lib/ant.jar:../lib/aopalliance-1.0.jar:../lib/asm-all-5.0.3.jar:../lib/aspectjweaver.jar:../lib/CCP_REST_SDK_JAVA_v2.7r.jar:../lib/commons-beanutils-1.9.1.jar:../lib/commons-codec-1.9.jar:../lib/commons-collections-3.2.jar:../lib/commons-dbcp2-2.0.jar:../lib/commons-fileupload-1.3.1.jar:../lib/commons-io-2.4.jar:../lib/commons-logging-1.1.3.jar:../lib/commons-logging-1.2.jar:../lib/commons-net-3.6.jar:../lib/commons-pool2-2.2.jar:../lib/cxf-2.2.5.jar:../lib/dom4j-1.6.1.jar:../lib/fastjson1.1.40.jar:../lib/fluent-hc-4.5.3.jar:../lib/fsdp2_common_2.0.21.jar:../lib/fsdp2_server.jar:../lib/fsdp2_service_2.0.21.jar:../lib/httpclient-4.4.1.jar:../lib/httpclient-4.5.3.jar:../lib/httpclient-cache-4.4.1.jar:../lib/httpclient-cache-4.5.3.jar:../lib/httpclient-win-4.4.1.jar:../lib/httpclient-win-4.5.3.jar:../lib/httpcore-4.4.1.jar:../lib/httpcore-4.4.6.jar:../lib/httpmime-4.4.1.jar:../lib/httpmime-4.5.3.jar:../lib/jackson-core-asl-1.9.4.jar:../lib/jackson-core-lgpl-1.9.6.jar:../lib/jackson-mapper-asl-1.9.5.jar:../lib/jackson-mapper-lgpl-1.9.6.jar:../lib/jedis-2.8.0.jar:../lib/jna-4.1.0.jar:../lib/jna-platform-4.1.0.jar:../lib/json.jar:../lib/jstl-1.1.2.jar:../lib/junit-1.3.jar:../lib/log4j-api-2.0-rc1.jar:../lib/log4j-core-2.0-rc1.jar:../lib/mail.jar:../lib/mysql-connector-java-5.1.30-bin.jar:../lib/ojdbc6.jar:../lib/poi-3.10.jar:../lib/poi-ooxml-3.10.jar:../lib/poi-ooxml-schemas-3.10.jar:../lib/servlet-api.jar:../lib/simplecaptcha-1.2.1.jar:../lib/spring-aop-4.0.1.RELEASE.jar:../lib/spring-beans-4.0.1.RELEASE.jar:../lib/spring-context-4.0.1.RELEASE.jar:../lib/spring-core-4.0.1.RELEASE.jar:../lib/spring-data-redis-1.6.4.RELEASE.jar:../lib/spring-expression-4.0.1.RELEASE.jar:../lib/spring-jdbc-4.0.1.RELEASE.jar:../lib/spring-oxm-4.1.9.RELEASE.jar:../lib/spring-security-config-3.0.0.RC2.jar:../lib/spring-security-core-3.0.0.RC2.jar:../lib/spring-security-web-3.0.0.RC2.jar:../lib/spring-tx-4.0.1.RELEASE.jar:../lib/spring-web-4.0.1.RELEASE.jar:../lib/spring-webmvc-4.0.1.RELEASE.jar:../lib/standard-1.1.2.jar:../lib/sun.misc.BASE64Decoder.jar:../lib/tools.jar:../lib/wss4j-1.5.8.jar:../lib/xmlbeans-2.3.0.jar
export JAVA_HOME=/finedo/jdk1.7.0_79
cd /datafine/local/paas_interface/bin

if [ $1 == 1 ];then
auditengine_pid=`ps -wef | grep downloadinterface | grep -v grep | awk '{print $2}'`
if test -z $auditengine_pid
then
        $JAVA_HOME/bin/java -Ddownloadinterface -Xms2048m -Xmx2048m -classpath $CLASSPATH cn.finedo.paas.download.DownloadInterface $2 $3 $4
else
        echo "The downloadinterface A has running , pid=${auditengine_pid}"
fi
else
auditengine_pid=`ps -wef | grep uploadinterface | grep -v grep | awk '{print $2}'`
if test -z $auditengine_pid
then
        $JAVA_HOME/bin/java -Duploadinterface -Xms2048m -Xmx2048m -classpath $CLASSPATH cn.finedo.paas.upload.UploadInterface $2 $3 $4 
else
        echo "The uploadinterface A has running , pid=${auditengine_pid}"
fi
fi
一定要有fi结束标志,不然会报错的!

你可能感兴趣的:(Linux)