help-octave
[Top][All Lists]
Advanced

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

Re: Executable Octave script: odd behavior when called with option ‘-dis


From: Kai Torben Ohlhus
Subject: Re: Executable Octave script: odd behavior when called with option ‘-display’
Date: Sat, 15 Sep 2018 17:59:56 +0200

On Fri, Sep 14, 2018 at 10:31 PM Bernd Lütkenhöner <address@hidden> wrote:

Hi


Trying to call an executable Octave script with the option -display I found an odd behavior. This behavior can already be found in the trivial script ‘hello’:

#! /usr/bin/octave -qf
disp('Hello world');

Calling this script as
./hello
./hello -disp xyz
./hello -display

yields, as expected, the output ‘Hello world’. However, no output appears if I call the script as
./hello -display xyz
I could easily avoid the problem by changing, in my software, the name of the option (e.g. ‘disp’ instead of ‘display’). However, I am curious to understand what goes wrong.

My Octave version is 4.2.2 (running under Ubuntu).


---
Bernd


Dear Bernd,

What do you expect to happen when you call "./hello" with the "-disp" or "-display" argument?  At least both are not Octave command line arguments [1], thus I cannot say which program interprets them.  Maybe you take a close look at how to run proper Octave M-Files from command line.  For a script "hello.m" only containing the "disp('Hello world');" line you can call

/user/bin/octave -qf hello.m

HTH,
Kai

[1]: https://octave.org/doc/v4.2.2/Command-Line-Options.html

reply via email to

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