【问题标题】:GAMESS config script error on bash: syntax error near $<bash 上的 GAMESS 配置脚本错误:$< 附近的语法错误
【发布时间】:2017-04-04 19:37:55
【问题描述】:

我得到的错误如下:

新窗口打开后,请按回车继续../config: line 82: syntax error near unexpected token newline' ./config: line 82:set reply=$

我在 bash shell 中。该脚本最初是为 csh 设计的。我已将脚本的第一行更改为 #!/bin/bash。

脚本应该打开一个新窗口来输入一些变量进行配置。 . . .

echo "use the word 'type' to indicate it is a command for the other window."
echo " "
echo -n "After the new window is open, please hit enter to go on."
set reply=$<
tput clear

我已经检查并知道 shell 是交互式的。我没有使用 sh ./config 执行,而是尝试使用 bash ./config ;仍然是同样的错误。如果我在 shell 中输入

【问题讨论】:

  • 您引用的第 82 行中的反引号和单引号之间似乎有些混淆。此外,您不需要尖括号或set 来设置该变量。试试read REPLY;用户的输入将在$REPLY 中可用。
  • $
  • 原始的csh 脚本在未经修改的情况下在bash 中运行是不太可能的。

标签: linux bash shell compilation sh


【解决方案1】:

感谢肉类空间!我放弃了“修复”的想法,但让它运行起来。 当我在 tcsh 中时,有效的是运行脚本——脚本中不需要编辑。由于我只需要为配置文件设置所有内容,因此配置脚本如何生成实际的安装脚本并不重要。 生成之后,我只是切换到 bash 并且一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-27
    • 2014-11-13
    • 2022-01-08
    • 2016-09-06
    相关资源
    最近更新 更多