[shell] tomcat启动脚本评析

来源:互联网 发布:java数组转化为字符串 编辑:程序博客网 时间:2024/05/22 06:27


# -----------------------------------------------------------------------------
# Stop script for the CATALINA Server
# -----------------------------------------------------------------------------


# Better OS/400 detection: see Bugzilla 31132
os400=false
case "`uname`" in
OS400*) os400=true;;
esac


# resolve links - $0 may be a softlink
PRG="$0"


while [ -h "$PRG" ] ;  #判断文件是否存在,并且是一个符号连接
do
  ls=`ls -ld "$PRG"`
  # ls -a   不隐藏任何以. 开始的项目
  # ls -d   列出目录本身,不是目录里内容
  # ls -r   逆序排列
  # ls -R   递归显示子目录
  # ls -s   以块数形式显示每个文件分配的尺寸
  # ls -l   以长格式列出文件
  # ls -ld  文件名 ----> -rw-r--r--. 1 root root 41 8月 4 15:47 /test/tt.txt
  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 exists
if $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" stop "$@"
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 系统盘读不出来怎么办 waifai密码忘了怎么办 window xp忘记密码怎么办 winxp密码忘了怎么办 xp电脑密码忘记怎么办 xp桌面图标有阴影怎么办 联想电脑忘记登录密码怎么办 xp系统忘掉密码怎么办 xp密码忘记了怎么办 电脑忘记开机密码怎么办 注销了win7用户名怎么办 xp启动后黑屏怎么办 开机要按esc怎么办 excel产品激活失败怎么办 米粉卡激活失败怎么办 电脑死机ppt保存怎么办 电脑装系统黑屏怎么办 电脑c盘无法访问怎么办 d盘变成ntfs怎么办 系统重装卡住了怎么办 系统关机没反应怎么办 232串口打开失败怎么办 逆水寒cpu不支持怎么办 显卡被禁用了怎么办 vmvare注册错了怎么办 电脑主机未成功启动怎么办 主机未成功启动怎么办 电脑主机未能成功启动怎么办 虚拟机没有自带怎么办 错误连接为720怎么办 dns错误不能上网怎么办 家里无线用不了怎么办 磁盘c5坏了怎么办 一体机装xp蓝屏怎么办 虚拟机密码忘记了怎么办 vivoy66手机太卡怎么办 虚拟机装xp蓝屏怎么办 exagear玩起来卡怎么办 第五人格模拟器玩太卡怎么办 速腾油箱盖打不开怎么办 奥迪a6油箱盖打不开怎么办