问个linux的简单问题 启动tomcat

a312983516 2012-04-10 05:12:05
linux下有两个tomcat文件 一个是A:原来的 一个是我从A复制过来的B 在A的bin下打 sh startup.sh就可以启动

在B文件的bin下 打sh startup.sh就报错
: command not found
: command not found:
: command not found:
'tartup.sh: line 27: syntax error near unexpected token `in
'tartup.sh: line 27: `case "`uname`" in

求解释 并教一下怎么配置 谢了
...全文
334 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoA76 2013-03-28
  • 打赏
  • 举报
回复
还有你同时启动两个tomcat是有端口冲突的,自己改哈端口
xiaoA76 2013-03-28
  • 打赏
  • 举报
回复
a312983516 a312983516 等级: 结帖率:95.24% 楼主 发表于: 2012-04-10 17:12:05 linux下有两个tomcat文件 一个是A:原来的 一个是我从A复制过来的B 在A的bin下打 sh startup.sh就可以启动 在B文件的bin下 打sh startup.sh就报错 : command not found : command not found: : command not found: 'tartup.sh: line 27: syntax error near unexpected token `in 'tartup.sh: line 27: `case "`uname`" in ================================================================================= 你这个肯定是命令没有发现,直接chmod 755 * ;然后: ./startup.sh 就可以了!
wqkjj 2012-04-13
  • 打赏
  • 举报
回复
#!/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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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 562770 2007-08-04 22:13:58Z markt $
# -----------------------------------------------------------------------------

# Better OS/400 detection: see Bugzilla 31132


正常情况下,2,17,23行为一个空行,shell不会报告那个错误的。
怀疑你的那个文件包含了shell不能识别的字符,比如汉字的空格0xa1a1之类。
用可以UltraEdit或者其它可以以十六进制显示文件的内容的编辑软件看看startup.sh有啥特殊字符咯。要不,重新复制那个可以正常运行的startup.sh文件。
a312983516 2012-04-12
  • 打赏
  • 举报
回复
绝对路径也不行

sh /home/cuiyl/tomcat_smsAlarm/bin/startup.sh
: command not foundsmsAlarm/bin/startup.sh: line 2:
: command not foundsmsAlarm/bin/startup.sh: line 17:
: command not foundsmsAlarm/bin/startup.sh: line 23:
'home/cuiyl/tomcat_smsAlarm/bin/startup.sh: line 27: syntax error near unexpected token `in
'home/cuiyl/tomcat_smsAlarm/bin/startup.sh: line 27: `case "`uname`" in
a312983516 2012-04-12
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
可执行文件的路径是否在环境变量中?
不在的话用绝对路径
[/Quote]


哦 如果我想直接打sh 不需要接绝对路径的话 也就是去配置环境变量 应该在哪里配置 求解释
zzbutcher 2012-04-10
  • 打赏
  • 举报
回复
打 sh /绝对路径/startup.sh 试一下
昵称很不好取 2012-04-10
  • 打赏
  • 举报
回复
可执行文件的路径是否在环境变量中?
不在的话用绝对路径
a312983516 2012-04-10
  • 打赏
  • 举报
回复
我靠 我自己顶 不是要沉吧

23,121

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧