[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Windows octave.bat anomaly?

From: John Donoghue
Subject: Windows octave.bat anomaly?
Date: Tue, 2 Feb 2016 19:52:00 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

On 02/02/2016 11:31 AM, address@hidden wrote:
essage: 4
Date: Tue, 2 Feb 2016 05:42:37 +0000 (UTC)
From: Stub<address@hidden>
To:"address@hidden"  <address@hidden>
Subject: Windows octave.bat anomaly?
Content-Type: text/plain; charset=UTF-8


I want to use Octave as a batch script on a Windows 7 PC, so that the standard 
output is shown in the calling terminal and optionally can be redirected to a 

(In fact, I want to use Octave for a Matlab script on a HTCondor network, where 
the Matlab script is executed on a remote PC without Matlab installed. HTCondor 
first upzips the Octave zipped-package, and then calls octave with the Matlab 
script. HTCondor collects the standard output and sends it back as a file. 
Therefore Octave should work as a simple terminal command.)

It is most convenient to use the "octave-4.0.0\octave.bat", because this batch 
sets all necessary stuff to run the binary octave-cli.exe program.

However, Octave without GUI is still configured to open in a separate window, 
which I find odd when no GUI is requested. See the implementation in the 
octave.bat file:

============ octave-4.0.0\octave.bat ===========
Rem   Start Octave (this detaches and immediately returns):
if %GUI_MODE%==1 (
start octave-gui.exe %*
) else (
start octave-cli.exe %*

Rem   Close the batch file's cmd.exe window

============ octave-4.0.0\octave.bat ===========

I have two objections here:

1) The batch script executes the "start octave-cli.exe" line when given the "--no-gui" 
option, but "start" opens octave in a new window! I'd say, no GUI means: stay in the same 
terminal/window as the calling batch.

2) The last line of the batch has "exit", but that will then also close the cmd.exe that 
calls the octave.bat ("exit" implodes the call to octave).

Therefore I suggest following modifications as more sensible:
============ octave-4.0.0\octave.bat ===========
Rem Start Octave (this detaches and immediately returns):
if %GUI_MODE%==1 (
start octave-gui.exe %*
Rem Close the batch file's cmd.exe windowexit
) else (
call octave-cli.exe %*
Rem Close the current batch scriptexit /b

============ octave-4.0.0\octave.bat ===========

Oh, another little thing: the Octave website talks about the --no-gui-libs 
option, but the octave scripts/executables do not mention this option, nor do 
they seem to recognize it.


Windows octave no longer even uses the .bat file - instead running via a vbs file as there had been issues with it opening up terminal windows when they were not wanted.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]