【发布时间】:2013-05-10 22:57:49
【问题描述】:
此脚本中的第 5 行有什么问题(我已经包含了给出错误的 sn-p,实际错误列在代码和完整脚本链接之后的底部)?
#! /bin/bash
INSTALLDIR=/usr/local/mapguideopensource
CLEAN_FLAG=0
while [ $# -gt 0 ]; do # Until you run out of parameters...
case "$1" in
-prefix|--prefix)
INSTALLDIR="$2"
shift
;;
-clean|--clean)
CLEAN_FLAG=1
shift
;;
-help|--help)
echo "Usage: $0 (options)"
echo "Options:"
echo " --prefix [installation directory]"
echo " --clean [clean all objects and binaries in Oem]"
echo " --help [Display usage]"
exit
;;
esac
shift # Check next set of parameters.
done
这是我在 linux (REHL5) 上运行此 bash 脚本时遇到的错误:
: command not founde 4:
: command not founde 8:
: command not founde 8:
: command not founde 12:
MapGuide Open Source build script for OEM components
'/build_oem.sh: line 17: syntax error near unexpected token `in
'/build_oem.sh: line 17: ` case "$1" in
请注意,上面的行号对应于我正在运行的实际脚本(我在下面包含了指向该脚本的链接) The original script i am running
【问题讨论】:
-
任何“这个脚本有什么问题”的问题在定义上都过于本地化——它只与那个单一的脚本相关。