bugGNU Octave - Bugs: bug #60111, History gets polluted with too...

 
 

bug #60111: History gets polluted with too many comment lines

Submitter:  None
Submitted:  Wed 24 Feb 2021 10:15:03 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * dev
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 25 Feb 2021 07:27:34 PM UTC, comment #3: 

Great, glad it works for you.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Thu 25 Feb 2021 07:20:01 PM UTC, comment #2: 

Oh! Excellent solution! Thank you to Rik. I will use -H with eval.

Anonymous
Thu 25 Feb 2021 04:18:29 PM UTC, comment #1: 

Try 'octave -h' to see a list of command-line options you can use with Octave.

In this case,


 --no-history, -H        Don't save commands to the history list


So if you want to run a data processing session from the command line, rather than start an interactive session where you want to record what you did, then just use


octave -H --eval 'XXX'



Rik <rik5>
Group administrator
Wed 24 Feb 2021 10:15:03 PM UTC, original submission:  

Hello,

This is unusual behavior I have not seen earlier. If anyone has a workaround suggestion I will try it. The core problem is that when Octave is started it injects a comment line like this into the history file:


# Octave 7.0.0, Wed Feb 24 12:46:13 2021 EST <user@host>


This has become a problem recently. I have a directory with several thousand binary .mat files that are the results of months worth of parallel runs. I have needed to run something like this from the bash prompt a few times to gather statistics for example:


for i in *.mat
do
    octave --eval "load $i; disp(size(var,1));"
done


Unfortunately I found out the hard way that invoking thousands of instances of "octave --eval" added that many lines of time stamp comments to the history, and now all earlier useful Octave commands have been removed from history.

I will work around this in future by not invoking "octave --eval" from the shell prompt to do statistics.

Are there workarounds for the following?

1. Prevent Octave from adding anything to history when being invoked as "octave --eval". After all, the actual command after eval is not stored, only the comment about when Octave was invoked, which is useless in this context.

2. Optionally, maybe prevent Octave from storing time stamp comments at all?

Anonymous

 

(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 rik5 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-02-25 rik5 StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code