设为首页
收藏本站
用户名
Email
自动登录
找回密码
密码
登录
注册
快捷导航
平台
Portal
论坛
BBS
文库
项目
群组
Group
我的博客
Space
搜索
搜索
热搜:
shell
linux
mysql
本版
用户
LinuxSir.cn,穿越时空的Linuxsir!
»
论坛
›
Linux 综合讨论区 —— LinuxSir.cn
›
shell进阶应用、shell编程
›
执行一个setup.sh脚本时出错
返回列表
查看:
1028
|
回复:
4
执行一个setup.sh脚本时出错
[复制链接]
jakee304
jakee304
当前离线
积分
43
IP卡
狗仔卡
发表于 2007-2-23 08:14:29
|
显示全部楼层
|
阅读模式
sh setup.sh
这样执行脚本setup.sh时出错,说函数未找到
见下
uml@yzw:/cdrom$ sh setup.sh
setup.sh: 9: function: not found
x86
uml@yzw:/cdrom$
复制代码
出现这个问题主要是什么原因?
回复
使用道具
举报
提升卡
置顶卡
沉默卡
喧嚣卡
变色卡
显身卡
sprite
sprite
当前离线
积分
141
IP卡
狗仔卡
发表于 2007-2-23 10:35:09
|
显示全部楼层
贴内容出来看看
回复
支持
反对
使用道具
举报
显身卡
jakee304
jakee304
当前离线
积分
43
IP卡
狗仔卡
楼主
|
发表于 2007-2-23 23:38:22
|
显示全部楼层
#!/bin/sh
#
# Product setup script - Loki Entertainment Software
# Go to the proper setup directory (if not already there)
cd `dirname $0`
# Return the appropriate architecture string
function DetectARCH {
status=1
case `uname -m` in
i?86) echo "x86"
status=0;;
*) echo "`uname -m`"
status=0;;
esac
return $status
}
# Return the appropriate version string
function DetectLIBC {
status=1
if [ -f `echo /lib/libc.so.6* | tail -1` ]; then
if fgrep GLIBC_2.1 /lib/libc.so.6* 2>&1 >/dev/null; then
echo "glibc-2.1"
status=0
else
echo "glibc-2.0"
status=0
fi
elif [ -f /lib/libc.so.5 ]; then
echo "libc5"
status=0
else
echo "unknown"
fi
return $status
}
# Detect the Linux environment
arch=`DetectARCH`
libc=`DetectLIBC`
# Find the installation program
function try_run
{
setup=$1
shift
fatal=$1
if [ "$1" != "" ]; then
shift
fi
# First find the binary we want to run
failed=0
setup_bin="setup.data/bin/$arch/$libc/$setup"
if [ ! -f "$setup_bin" ]; then
setup_bin="setup.data/bin/$arch/$setup"
if [ ! -f "$setup_bin" ]; then
failed=1
fi
fi
if [ "$failed" -eq 1 ]; then
if [ "$fatal" != "" ]; then
cat <<__EOF__
This installation doesn't support $libc on $arch
Please contact Loki Technical Support at support@lokigames.com
__EOF__
exit 1
fi
return $failed
fi
# Try to run the binary
# The executable is here but we can't execute it from CD
setup="$HOME/.setup$$"
cp "$setup_bin" "$setup"
chmod 700 "$setup"
if [ "$fatal" != "" ]; then
"$setup" $*
failed=$?
else
"$setup" $* 2>/dev/null
failed=$?
fi
rm -f "$setup"
return $failed
}
# Try to run the setup program
status=0
rm -f "$setup"
if ! try_run setup.gtk && ! try_run setup -fatal; then
echo "The setup program seems to have failed on $arch/$libc"
echo
echo "Please contact Loki Technical Support at support@lokigames.com"
status=1
fi
exit $status
复制代码
是我哪里没有配置好吗?
回复
支持
反对
使用道具
举报
显身卡
Yuri
Yuri
当前离线
积分
3231
IP卡
狗仔卡
发表于 2007-2-24 00:20:27
|
显示全部楼层
把funcation这个词去掉就可以运行了。
回复
支持
反对
使用道具
举报
显身卡
jakee304
jakee304
当前离线
积分
43
IP卡
狗仔卡
楼主
|
发表于 2007-2-25 20:03:00
|
显示全部楼层
Post by
Yuri
把funcation这个词去掉就可以运行了。
我没写过脚本,去掉之后还可以正确执行吗?
还有如何在不改变这个执行脚本的情况下,执行它?比如修改环境配置等等
回复
支持
反对
使用道具
举报
显身卡
返回列表
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖后跳转到最后一页
浏览过的版块
Redhat/Fedora/CentOS Linux
BSD 讨论专题
Debian Linux
硬件设备 Linux 驱动
Linux 程序设计专题讨论
LFS(LinuxfromScratch)
服务器架设、应用、维护
Archlinux讨论区
红旗 REDFLAG Linux
Copyright © 2002-2023
LinuxSir.cn
(http://www.linuxsir.cn/) 版权所有 All Rights Reserved.
Powered by
RedflagLinux!
技术支持:
中科红旗
|
京ICP备19024520号
快速回复
返回顶部
返回列表