[英]How can I start octave from the command line and not the GUI?
我最近使用 Homebrew 在我的 Mac 上安装了 GNU Octave,一旦我在 bash 中输入octave
,它就会打开八度图形界面。 Octave GUI 看起来很不吸引人(至少在 Mac 上)所以我想使用命令行界面。 我的解决方法是在~/.bash_profile
创建一个永久别名,即alias octave='octave --no-gui'
。
有没有更永久的解决方法? 也就是说,如何在不调用 GUI 而不是 CLI 的情况下开始使用八度音程? 有没有一种解决方案,我不必通过使用别名来做到这一点。 (并不是说使用别名是一个大问题,但我只是想更好地修复在命令行本身上启动 Octave。)
我也通过 brew 安装我发现只需运行:
octave-cli
您将在终端中看到八度音程:
GNU Octave, version 4.2.0-rc2
Copyright (C) 2016 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
...
octave:1>
您可以从八度http://wiki.octave.org/Octave_for_Microsoft_Windows的 wiki 获取信息:
Octave-3.8.2
为 ver. 的 windows 提供以前版本的八度音程的站点。 3.8.2(使用 mxe-octave 的非官方构建)已关闭。 可以在Octave for Windows 的文件列表中下载镜像二进制文件。
如果您在运行 Windows 8 或 libstdc++-6.dll 错误时遇到任何问题,请尝试使用这个 Octave-gui.bat 文件并将其放入您的 Octave 文件夹(例如C:/octave/octave-3.8.2
)。
@echo off
set PATH=%CD%\bin\
start octave --force-gui -i --line-editing
exit
简单地说,您只需将C:\\Octave\\Octave-3.8.2\\bin
文件夹路径添加到您的 Environment Variables ,如下所示:
在 MacOS 上,如果通过 dmg 文件安装 Octave,您可以在 ~/.bashrc 文件中添加别名。
alias octave-cli='/Applications/Octave-4.4.1.app/Contents/Resources/usr/bin/octave-cli'
然后通过'octave-cli'在命令行中启动octave-cli。
对于 mac os
alias octave-cli='/Applications/Octave-4.4.1.app/Contents/Resources/usr/bin/octave-octave-app --no-gui'
https://octave.org/doc/v4.2.2/Command-Line-Options.html#Command-Line-Options
在 Windows 上,使用 Octave 版本 6.2.0
D:\Programs\GNU_Octave\Octave-6.2.0\mingw64\bin>octave-cli.exe
旁注:我安装到一个没有空格的自定义路径中,而不是 C:\\Program Files\\GNU Octave 中的默认路径。 当路径中有空格时,至少有些功能失败了。 我不确定 Octave-cli 是否会起作用。
完整的控制台输出:
D:\Programs\GNU_Octave\Octave-6.2.0\mingw64\bin>octave-cli.exe
GNU Octave, version 6.2.0
Copyright (C) 2021 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.
Octave was configured for "x86_64-w64-mingw32".
Additional information about Octave is available at https://www.octave.org.
Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html
Read https://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.
octave:1>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.