簡體   English   中英

如何從命令行而不是 GUI 啟動八度音程?

[英]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>

根據這里

octave -W

將強制在 CLI 中打開八度音程。 它對我有用。

您可以從八度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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM