简体   繁体   English

错误“语法错误附近意外的令牌'&'-尝试从应用程序中的命令行运行文件

[英]Error "syntax error near unexpected token '&' - trying to run a file from command line within an application

I am a newbie to Linux and I am only really using it to use a program for my final year thesis. 我是Linux的新手,我只在最后一年的论文中才真正使用它来使用程序。 I have got to grips with the language for the program but am having issues with actually running it in Linux. 我已经掌握了该程序的语言,但是在Linux上实际运行时遇到了问题。 The program is called "CACTUS" and all documentation can be found here . 该程序称为“ CACTUS”,所有文档都可以在此处找到。

I have extracted the application file and I have made the executable as instructed in the install.txt file: 我已经提取了应用程序文件,并按照install.txt文件中的说明制作了可执行文件:

"Installation of CACTUS for Linux or Mac machines. “为Linux或Mac计算机安装CACTUS。

  1. Unzip the directory and put in desired location. 解压目录并放在所需位置。 On terminal cd into the correct directory (you should be able to see the makefiles). 在终端cd上进入正确的目录(您应该能够看到makefile)。

  2. Create the executable by typing: 通过键入以下内容来创建可执行文件:

    $make

    or 要么

    $make -f Makefile.gfortran

    on the terminal. 在终端上。 The executable will be called cactus and be located in the directory one level above.You can add the executable's location to your path so that you can call it by simple typing cactus on the terminal instead of the complete path. 该可执行文件称为cactus ,位于上一级目录中。您可以将可执行文件的位置添加到路径中,以便可以通过在终端上简单键入cactus而不是完整路径来调用该可执行文件。

  3. cd into the Test/RegTest directory cd进入Test / RegTest目录

    $cd ./Test/RegTest

    and run the RegTest by executing runreg.py with the path to the CACTUS executable as an argument (or just the name of the executable if you added it to your path). 并通过执行runreg.py并使用CACTUS可执行文件的路径作为参数(或者如果将可执行文件添加到路径,则只是可执行文件的名称)来运行RegTest

    $./runreg.py ../../../cactus

    or 要么

    $./runreg.py cactus

    The output should say 'No differences' for all three tests. 对于所有三个测试,输出均应显示“无差异”。 Note: if you have Python 3 installed used runreg_p3.py instead. 注意:如果您安装了Python 3改用runreg_p3.py

    CONGRATULATIONS! You have successfully installed CACTUS.

I have run this and I didn't get the "No Differences" returned on the runreg.py. 我已经运行了此程序,但没有在runreg.py上返回“ No Differences”。 I continued anyway as I did not know why or how I could fix this. 无论如何我还是继续,因为我不知道为什么或如何解决这个问题。 (This may be a root cause of my overally problem here) (这可能是我这里总体问题的根本原因)

As I progressed I have been trying to open an input file "TestVAWT.in" from TestCase2 with the following command: 随着我的进步,我一直在尝试使用以下命令从TestCase2打开输入文件“ TestVAWT.in”:

./TestVAWT.in ../../../cactus

From this I get the error in the title returned. 由此我得到返回标题中的错误。 Am I correct in assuming that it has tried to run the TestVAWT.in file on the command line without referring to the Cactus application which I presume would be able to read the '&' prefix of the code along with the rest of the input file. 我是否正确假设它已尝试在命令行上运行TestVAWT.in文件而不引用Cactus应用程序,我认为该应用程序将能够读取代码的'&'前缀以及其余的输入文件。 Or is it something else I am missing here. 还是我在这里想念的其他东西。

I would appreciate any help as I have been banging my head against a wall for some time now. 我已经将头撞墙了一段时间了,我将提供任何帮助,我们将不胜感激。

Note: I am using Ubuntu 14.04 LTS . 注意:我正在使用Ubuntu 14.04 LTS

Best Regards 最好的祝福

Richard 理查德

Don't know the application, but looks kind of strange to me. 不知道应用程序,但对我来说有点奇怪。 Please try adding the Input-File as a parameter: 请尝试将输入文件添加为参数:

cactus TestVAWT.in

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM