早教吧作业答案频道 -->其他-->
linux中tomcat启动脚本,/bin/sh#LicensedtotheApacheSoftwareFoundation(ASF)underoneormore#contributorlicenseagreements.SeetheNOTICEfiledistributedwith#thisworkforadditionalinformationregardingcopyrightownership.#TheASF
题目详情
linux 中tomcat启动脚本,
/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more# contributor license agreements.See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License,Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing,software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------------# Start Script for the CATALINA Server
#
# $Id:startup.sh 1130937 2011-06-03 08:27:13Z markt $
# -----------------------------------------------------------------------------
# Better OS/400 detection:see Bugzilla 31132os400=false
darwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
Darwin*) darwin=true;;
esac
# resolve links - $0 may be a softlinkPRG="$0"
while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"`
link=`expr "$ls" :'.*-> \(.*\)$'`
if expr "$link" :'/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh
# Check that target executable existsif $os400; then
# -x will Only work on the os400 if the files are:
# 1.owned by the user
# 2.owned by the PRIMARY group of the user
# this will not work if the user belongs in secondary groups
eval
else
if [ -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi
fi
exec "$PRGDIR"/"$EXECUTABLE" start "$@"
请高手说明一下每行的作用.
/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more# contributor license agreements.See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License,Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing,software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------------# Start Script for the CATALINA Server
#
# $Id:startup.sh 1130937 2011-06-03 08:27:13Z markt $
# -----------------------------------------------------------------------------
# Better OS/400 detection:see Bugzilla 31132os400=false
darwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
Darwin*) darwin=true;;
esac
# resolve links - $0 may be a softlinkPRG="$0"
while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"`
link=`expr "$ls" :'.*-> \(.*\)$'`
if expr "$link" :'/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
PRGDIR=`dirname "$PRG"`
EXECUTABLE=catalina.sh
# Check that target executable existsif $os400; then
# -x will Only work on the os400 if the files are:
# 1.owned by the user
# 2.owned by the PRIMARY group of the user
# this will not work if the user belongs in secondary groups
eval
else
if [ -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi
fi
exec "$PRGDIR"/"$EXECUTABLE" start "$@"
请高手说明一下每行的作用.
▼优质解答
答案和解析
#!/bin/sh ---- 说明本文件是脚本
darwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
Darwin*) darwin=true;;
esac
----------------------------这几行,判断操作系统类别
while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"`
link=`expr "$ls" :'.*-> \(.*\)$'`
if expr "$link" :'/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
-------------------------------------------判断本脚本是否软链接
if [ !-x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi
------------------------------判断本脚本是否能“执行”,如果不能,退出、提示
exec "$PRGDIR"/"$EXECUTABLE" start "$@" ------运行tomcat,后面的 $@是所有命令行参数
darwin=false
case "`uname`" in
CYGWIN*) cygwin=true;;
OS400*) os400=true;;
Darwin*) darwin=true;;
esac
----------------------------这几行,判断操作系统类别
while [ -h "$PRG" ] ; do ls=`ls -ld "$PRG"`
link=`expr "$ls" :'.*-> \(.*\)$'`
if expr "$link" :'/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
fi
done
-------------------------------------------判断本脚本是否软链接
if [ !-x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
echo "The file is absent or does not have execute permission"
echo "This file is needed to run this program"
exit 1
fi
------------------------------判断本脚本是否能“执行”,如果不能,退出、提示
exec "$PRGDIR"/"$EXECUTABLE" start "$@" ------运行tomcat,后面的 $@是所有命令行参数
看了linux中tomcat启动脚...的网友还看了以下:
偏微分方程U(t)=U(xx)怎么解其次满足U(0,t)=0,U(pi,t)=0满足形式为U(x, 2020-05-13 …
经济学中min2X¹+2X²和s.t.U=X¹X²=200(X¹,X²为商品1,2的数量)这两个式 2020-05-13 …
函数f(x)在(0,+∞)连续,f(1)=5/2,对所有x,t∈(0,+∞),满足∫(1,x)f( 2020-05-19 …
试写出系列函数复合函数的表达式1:y=根号u,u=x平方+2x-12:y=u平方+2u+1,u=s 2020-06-03 …
问一道考研高等数学里面关于变限积分的问题上限X下限0tf(x-t)dt书上是说设x-t=u然后化成 2020-06-10 …
设f(x)=定积分(ln(1+t)/t)dt(x>0),上限x,下限1,求f(x)+f(1/x)设 2020-07-09 …
变上限积分区间0-x,F(x)=∫tf(x-t)dt将x-t=u,那变成区间还是0-x,∫(x-u 2020-07-10 …
高数变上限积分求导问题!题目是这样的:曲线y=∫sin(x-t)dt(下限为0,上限为x)在点x= 2020-07-31 …
对于积分上限函数∫(a,t)f(y)dy,知道被积函数是f(t).那么对于∫(a,t)f(x+y) 2020-08-02 …
∫tf(x-t)dt令x-t=u,为什么变成了∫(x-u)f(u)du啊,t=x-u,那dt不是应该 2021-01-13 …