+ -
当前位置:首页 → 问答吧 → linux下各种模拟器介绍和使用方法(更新结束)

linux下各种模拟器介绍和使用方法(更新结束)

时间:2011-05-26

来源:互联网

简单分析了一下,似乎是创建目录变量什么的,最后有一个疑似…运行的命令
尝试直接sh,输出结果只是:XXX:是一个目录
另外还有Mac的可执行文件:portal2.osx

如果这个脚本能运行成功的话,就可以摆脱Wine了?

附:全文
代码:
#!/bin/bash

# figure out the absolute path to the script being run a bit
# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
# specified directory, then uses $PWD to figure out where that
# directory lives - and all this in a subshell, so we don't affect
# $PWD

GAMEROOT=$(cd "${0%/*}" && echo $PWD)

#determine platform
UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
elif [ "$UNAME" == "Linux" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
fi

if [ -z $GAMEEXE ]; then
   if [ "$UNAME" == "Darwin" ]; then
      GAMEEXE=portal2_osx
   fi
fi

ulimit -n 2048

# and launch the game
cd "$GAMEROOT"

STATUS=42
while [ $STATUS -eq 42 ]; do
   if [ "${DEBUGGER}" == "gdb" ]; then
      ARGSFILE=$(mktemp $USER.portal2.gdb.XXXX)
      echo run $@ > "$ARGSFILE"
      ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -x "$ARGSFILE"
      rm "$ARGSFILE"
   else
      ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
   fi
   STATUS=$?
done
exit $STATUS


最后由 萌名雪 编辑于 2011-05-26 22:02,总共编辑了 2 次

作者: 萌名雪   发布时间: 2011-05-26

mac 也用shell

作者: luojie-dune   发布时间: 2011-05-26

shell里也是调用的那个osx啊

作者: 灰色小狼   发布时间: 2011-05-26

灰色小狼 写道:
shell里也是调用的那个osx啊

不是,里面有一个判断系统版本的语句,有Darwin和Linux两个判断

作者: 萌名雪   发布时间: 2011-05-26

一切都是假象=,=

作者: 枫叶饭团   发布时间: 2011-05-26

表示已经在win7下通关了

作者: wjh36845   发布时间: 2011-05-26

简单分析了一下,似乎是创建目录变量什么的,最后有一个疑似…运行的命令
尝试直接sh,输出结果只是:XXX:是一个目录
另外还有Mac的可执行文件:portal2.osx

如果这个脚本能运行成功的话,就可以摆脱Wine了?

附:全文
代码:
#!/bin/bash

# figure out the absolute path to the script being run a bit
# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
# specified directory, then uses $PWD to figure out where that
# directory lives - and all this in a subshell, so we don't affect
# $PWD

GAMEROOT=$(cd "${0%/*}" && echo $PWD)

#determine platform
UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
elif [ "$UNAME" == "Linux" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
fi

if [ -z $GAMEEXE ]; then
   if [ "$UNAME" == "Darwin" ]; then
      GAMEEXE=portal2_osx
   fi
fi

ulimit -n 2048

# and launch the game
cd "$GAMEROOT"

STATUS=42
while [ $STATUS -eq 42 ]; do
   if [ "${DEBUGGER}" == "gdb" ]; then
      ARGSFILE=$(mktemp $USER.portal2.gdb.XXXX)
      echo run $@ > "$ARGSFILE"
      ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -x "$ARGSFILE"
      rm "$ARGSFILE"
   else
      ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
   fi
   STATUS=$?
done
exit $STATUS


最后由 萌名雪 编辑于 2011-05-26 22:02,总共编辑了 2 次

作者: 萌名雪   发布时间: 2011-05-26

mac 也用shell

作者: luojie-dune   发布时间: 2011-05-26

shell里也是调用的那个osx啊

作者: 灰色小狼   发布时间: 2011-05-26

灰色小狼 写道:
shell里也是调用的那个osx啊

不是,里面有一个判断系统版本的语句,有Darwin和Linux两个判断

作者: 萌名雪   发布时间: 2011-05-26

一切都是假象=,=

作者: 枫叶饭团   发布时间: 2011-05-26

表示已经在win7下通关了

作者: wjh36845   发布时间: 2011-05-26

简单分析了一下,似乎是创建目录变量什么的,最后有一个疑似…运行的命令
尝试直接sh,输出结果只是:XXX:是一个目录
另外还有Mac的可执行文件:portal2.osx

如果这个脚本能运行成功的话,就可以摆脱Wine了?

附:全文
代码:
#!/bin/bash

# figure out the absolute path to the script being run a bit
# non-obvious, the ${0%/*} pulls the path out of $0, cd's into the
# specified directory, then uses $PWD to figure out where that
# directory lives - and all this in a subshell, so we don't affect
# $PWD

GAMEROOT=$(cd "${0%/*}" && echo $PWD)

#determine platform
UNAME=`uname`
if [ "$UNAME" == "Darwin" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH
elif [ "$UNAME" == "Linux" ]; then
   # prepend our lib path to LD_LIBRARY_PATH
   export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH
fi

if [ -z $GAMEEXE ]; then
   if [ "$UNAME" == "Darwin" ]; then
      GAMEEXE=portal2_osx
   fi
fi

ulimit -n 2048

# and launch the game
cd "$GAMEROOT"

STATUS=42
while [ $STATUS -eq 42 ]; do
   if [ "${DEBUGGER}" == "gdb" ]; then
      ARGSFILE=$(mktemp $USER.portal2.gdb.XXXX)
      echo run $@ > "$ARGSFILE"
      ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -x "$ARGSFILE"
      rm "$ARGSFILE"
   else
      ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
   fi
   STATUS=$?
done
exit $STATUS


最后由 萌名雪 编辑于 2011-05-26 22:02,总共编辑了 2 次

作者: 萌名雪   发布时间: 2011-05-26

mac 也用shell

作者: luojie-dune   发布时间: 2011-05-26

shell里也是调用的那个osx啊

作者: 灰色小狼   发布时间: 2011-05-26

灰色小狼 写道:
shell里也是调用的那个osx啊

不是,里面有一个判断系统版本的语句,有Darwin和Linux两个判断

作者: 萌名雪   发布时间: 2011-05-26

一切都是假象=,=

作者: 枫叶饭团   发布时间: 2011-05-26

表示已经在win7下通关了

作者: wjh36845   发布时间: 2011-05-26