octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #53951] Exit status after error running file f


From: Jenny Harlow
Subject: [Octave-bug-tracker] [bug #53951] Exit status after error running file from command line
Date: Sun, 20 May 2018 14:16:52 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0

URL:
  <http://savannah.gnu.org/bugs/?53951>

                 Summary: Exit status after error running file from command
line 
                 Project: GNU Octave
            Submitted by: jennyh
            Submitted on: Sun 20 May 2018 06:16:51 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Missed Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: GNU/Linux

    _______________________________________________________

Details:

There seems to be a change between 4.0.0 and 4.2.1 in how the exit status
reflects a runtime error when running a code (.m) file from the command line. 
Running the same (flawed) code from a file in 4.0.0 I get a non-zero exit
status but using 4.2.1 I get a zero exit status.  

*Example*
Given a file blah.m containing


x = y;
disp(x);


the bash command


if octave --silent blah.m; then echo 'OK'; else  echo 'Failed'; fi


outputs


error: 'y' undefined near line 1 column 5
error: execution exception in blah.m
OK


(ie, OK means zero exit status).

With Octave 4.0.0 the output is instead


error: 'y' undefined near line 1 column 5
error: called from
    blah.m at line 1 column 3
Failed


(ie, non-zero exit status)

*Comments*
It seems very similar to the issue in 4.2.0 using --eval
http://octave.1599824.n4.nabble.com/Octave-s-exit-status-td4680966.html

which was fixed in 4.2.1.  With that fix in 4.2.1, I get a non-zero exit
status if I run the flawed code above directly from the command line using the
_--eval code_ option, compared to the zero exit status when I run from the
file, which seems a bit inconsistent.

The same behaviour applies with a parse error rather than a runtime error.

Apologies if this has already been reported.  I have not posted here before so
this is a bit daunting but I have looked through the bug reports and cannot
find anything that looks like this issue.  Also apologies if this
differentiation between command line results using _file_ and _--eval code_ is
a 4.2.1 feature rather than a bug.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53951>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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