help-octave
[Top][All Lists]
Advanced

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

saving Octave state?


From: John W. Eaton
Subject: saving Octave state?
Date: Tue, 8 Jun 2010 09:55:44 -0400

On  8-Jun-2010, Mike Miller wrote:

| With GNU R it is possible to save the state of the program -- all objects 
| and history -- in the default directory so that if R is launched later in 
| that directory it will automatically return to it's past state.
| 
| Is it possible to do this with Octave?
| 
| It seems like a save command can save all arrays to disk in a path/file 
| the user requests.  So that is part of the picture, if I have that right.
| 
| The other trick is to reload the old history.  If I go with the default, 
| it will save the history in ~/.octave_hist, but so will every other octave 
| instance, and I often have several.  I could exit octave, then copy the 
| history to the default directory, but then I wouldn't know how to load the 
| history except by copying it to ~/.octave_hist, which seems like a bad 
| idea.
| 
| I have googled for this and I get lots of hits that aren't quite answering 
| my question, so I hope someone here can help me out.  Thanks in advance.

I think all you need to do to get a local history file loaded and
saved automatically is to set the name of the history file.  You can
do that with a command line option or by using

  history_file ("local-octave-session-history");

in your ~/.octaverc file, which is processed before Octave loads the
history.

If you want to prime this local file with the global history or the
history of some other session, then just use something like

  history -r ~/.octave_hist

the first time you run Octave in the directory.

jwe


reply via email to

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