bugGNU Octave - Bugs: bug #61207, Octave in interactive batch mode...

 
 

bug #61207: Octave in interactive batch mode does not wait for completion

Submitted by:  Daniel <daniel>
Submitted on:  Thu 23 Sep 2021 08:20:58 AM UTC  
 
Category:  Documentation Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  In Progress Assigned to:  None
Originator Name:  Daniel Open/Closed:  Open
Release:  6.3.0 Operating System:  Microsoft Windows

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 03 Oct 2021 12:13:11 PM UTC, comment #5: 

I pushed a change to the release branch of MXE Octave adding a note to the README.html file pointing to the wiki article mentioned earlier:
https://hg.octave.org/mxe-octave/rev/fa2337ae8097

Reading through the remainder of that file, I was wondering whether it would be possible to add a note similar to the following one to the page where the user selects the installation directory:

Some operations might fail if Octave is installed in a location containing spaces if short file names have been disabled for the file system of the installation folder. Some systems seem to have disabled that feature for some partitions (e.g., on D:). If you are unsure whether your file system supports short file names, chose an installation folder that doesn't contain spaces.

The readme file is shown after Octave is already installed. It might be nicer to show that message when (or before) the user selects the installation folder.

Markus Mützel <mmuetzel>
Project Member
Thu 23 Sep 2021 03:46:30 PM UTC, comment #4: 

Octave is primarily developed for POSIX platforms.

The .vbs and .bat files are meant to make it easier for a non-expert user to start Octave on Windows. These scripts serve as wrappers that set up the environment correctly for most of the use cases and then start Octave.
Unfortunately, these wrappers break some of the switches that you can use when calling Octave directly.

If you want to use "custom" command line switches on Windows and are not afraid to use a command line shell, you could use the "cmdshell.bat" script that you can find in Octave's installation folder.
It sets up the necessary environment variables and starts a bash.
At that bash, you should be able to run Octave with any of the switches that are shown by `octave-gui --help`.

Let us know if some of those switches don't work in that case.

It should also be possible to take that .bat file as a template and call octave directly instead of starting the bash. But tbh, I haven't tested that yet.

Markus Mützel <mmuetzel>
Project Member
Thu 23 Sep 2021 02:13:28 PM UTC, comment #3: 

Thanks for the fast response.
The following two options seem to work:

mingw64\bin\octave.bat --eval "run_my_code('C:temp\input.json')"

mingw64\bin\octave-cli.exe --eval "run_my_code('C:temp\input.json')"

The Options that are printed with --help are misleading. I think --no-gui and -i, --interactive has no impact here.

Does the option "Force interactive behavior" has any impact for any octave executable on Windows?

Daniel <daniel>
Thu 23 Sep 2021 11:54:16 AM UTC, comment #2: 

Duplicate of #60180.

Perhaps we could add something to the installer README about calling octave.

John Donoghue <lostbard>
Project Member
Thu 23 Sep 2021 08:49:40 AM UTC, comment #1: 

Does using the .bat file in the bin directory do what you need?

That information is buried somewhat deep in the wiki:
https://wiki.octave.org/Octave_for_Microsoft_Windows#Calling_Octave_executables

Markus Mützel <mmuetzel>
Project Member
Thu 23 Sep 2021 08:20:58 AM UTC, original submission:  

I want to start Octave in batch mode, run an octave script interactively and post process the output somewhere else in a single workflow.

The issue I identified is that the cmd prompt continues with a new line and octave starts in a new batch window. The cmd prompt does not wait until octave finishes.

The following lines all result in the same behaviour:

%SYSTEMROOT%\system32\wscript.exe "C:\Users\daniel\AppData\Local\Programs\GNU Octave\Octave-6.3.0\octave.vbs" --no-gui -i

%SYSTEMROOT%\system32\wscript.exe "C:\Users\daniel\AppData\Local\Programs\GNU Octave\Octave-6.3.0\octave.vbs" --no-gui --interactive

"C:\Users\daniel\AppData\Local\Programs\GNU Octave\Octave-6.3.0\octave" --no-gui -i

Daniel <daniel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by daniel (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-03 mmuetzel CategoryNone => Documentation
        StatusNone => In Progress

    Back to the top


    Powered by Savane 3.7