BASH and Octave: Difference between revisions

30 bytes added ,  30 November 2013
no edit summary
(Changed trail-and-error to trial-and-error)
No edit summary
Line 22: Line 22:


Now, imaging you have 'played around' in an interactive Octave session to try/test something: you want to save the commands you just used to not-forget. Just close the Octave session. If (in Linux) you close Octave that you have started from the command line, you will automatically return to the command line. Now you want to have a seperate copy of your last session put in a file (a {{Codeline|*.m}} file). On the command line, you just type {{Codeline|octave_save_last_session}}, and the last session (only!) is copied from the {{Codeline|~/.octave_hist}} file and saved to {{Codeline|octave_save_last_session.m}}. You can edit that file to remove parts you don't want to save, or you can re-execute the commands by {{Codeline|octave --persist octave_save_last_session.m}}.
Now, imaging you have 'played around' in an interactive Octave session to try/test something: you want to save the commands you just used to not-forget. Just close the Octave session. If (in Linux) you close Octave that you have started from the command line, you will automatically return to the command line. Now you want to have a seperate copy of your last session put in a file (a {{Codeline|*.m}} file). On the command line, you just type {{Codeline|octave_save_last_session}}, and the last session (only!) is copied from the {{Codeline|~/.octave_hist}} file and saved to {{Codeline|octave_save_last_session.m}}. You can edit that file to remove parts you don't want to save, or you can re-execute the commands by {{Codeline|octave --persist octave_save_last_session.m}}.
[[Category:Tips and tricks]]
501

edits