日期:2014-05-16  浏览次数:20762 次

问个linux的简单问题 启动tomcat
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

求解释 并教一下怎么配置 谢了

------解决方案--------------------
可执行文件的路径是否在环境变量中?
不在的话用绝对路径
------解决方案--------------------
打 sh /绝对路径/startup.sh 试一下
------解决方案--------------------
#!/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文件。