简体   繁体   English

如何从命令行而不是 GUI 启动八度音程?

[英]How can I start octave from the command line and not the GUI?

I recently installed GNU Octave on my Mac using Homebrew and as soon as I typed octave into bash, it opened up the octave-gui window.我最近使用 Homebrew 在我的 Mac 上安装了 GNU Octave,一旦我在 bash 中输入octave ,它就会打开八度图形界面。 The Octave GUI looks quite unappealing (on a mac, at least) so I wanted to use the command line interface. Octave GUI 看起来很不吸引人(至少在 Mac 上)所以我想使用命令行界面。 My fix was to create a permanent alias in ~/.bash_profile which was alias octave='octave --no-gui' .我的解决方法是在~/.bash_profile创建一个永久别名,即alias octave='octave --no-gui'

Is there a more permanent fix to this?有没有更永久的解决方法? That is, how can I start using octave without invoking the GUI instead of the CLI?也就是说,如何在不调用 GUI 而不是 CLI 的情况下开始使用八度音程? Is there a solution where I don't have to do this by using an alias.有没有一种解决方案,我不必通过使用别名来做到这一点。 (Not that using the alias is a big issue, but I just wanted a better fix to starting Octave on the command line itself.) (并不是说使用别名是一个大问题,但我只是想更好地修复在命令行本身上启动 Octave。)

I also install through brew I found that just run:我也通过 brew 安装我发现只需运行:

octave-cli

you will see the octave in terminal:您将在终端中看到八度音程:

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>

According to here :根据这里

octave -W

will force octave to open in CLI.将强制在 CLI 中打开八度音程。 It works for me.它对我有用。

you can get the infomation from the wiki of octave http://wiki.octave.org/Octave_for_Microsoft_Windows :您可以从八度http://wiki.octave.org/Octave_for_Microsoft_Windows的 wiki 获取信息:

Octave-3.8.2 Octave-3.8.2

The site that provide previous version of octave for windows of ver.为 ver. 的 windows 提供以前版本的八度音程的站点。 3.8.2 (unofficial build using mxe-octave) is closed. 3.8.2(使用 mxe-octave 的非官方构建)已关闭。 A mirrored binary can be downloaded at File list of Octave for Windows .可以在Octave for Windows 的文件列表中下载镜像二进制文件

If you got any problems while running Windows 8 or libstdc++-6.dll errors, try this octave-gui.bat file and place it into your Octave folder (eg C:/octave/octave-3.8.2 ).如果您在运行 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

Simplely, you can just add the the C:\\Octave\\Octave-3.8.2\\bin folder path to your Environment Variables , like this:简单地说,您只需将C:\\Octave\\Octave-3.8.2\\bin文件夹路径添加到您的 Environment Variables ,如下所示:

在此处输入图片说明

On MacOS, if installed Octave by dmg file, you can add alias to your ~/.bashrc file.在 MacOS 上,如果通过 dmg 文件安装 Octave,您可以在 ~/.bashrc 文件中添加别名。

alias octave-cli='/Applications/Octave-4.4.1.app/Contents/Resources/usr/bin/octave-cli'

Then start octave-cli in command line by 'octave-cli'.然后通过'octave-cli'在命令行中启动octave-cli。

for mac os对于 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 https://octave.org/doc/v4.2.2/Command-Line-Options.html#Command-Line-Options

On Windows, with Octave version 6.2.0在 Windows 上,使用 Octave 版本 6.2.0

D:\Programs\GNU_Octave\Octave-6.2.0\mingw64\bin>octave-cli.exe

Side note: I installed into a custom path without spaces, NOT the default path which would have been in C:\\Program Files\\GNU Octave.旁注:我安装到一个没有空格的自定义路径中,而不是 C:\\Program Files\\GNU Octave 中的默认路径。 At least some features failed when I had spaces in the path.当路径中有空格时,至少有些功能失败了。 I'm not sure if the octave-cli would have worked.我不确定 Octave-cli 是否会起作用。

Full console output:完整的控制台输出:

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.

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