<html lang="en"> <head> <title>Diary and Echo Commands - Untitled</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Untitled"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Command-Line-Editing.html#Command-Line-Editing" title="Command Line Editing"> <link rel="prev" href="Customizing-the-Prompt.html#Customizing-the-Prompt" title="Customizing the Prompt"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Diary-and-Echo-Commands"></a> <p> Previous: <a rel="previous" accesskey="p" href="Customizing-the-Prompt.html#Customizing-the-Prompt">Customizing the Prompt</a>, Up: <a rel="up" accesskey="u" href="Command-Line-Editing.html#Command-Line-Editing">Command Line Editing</a> <hr> </div> <h4 class="subsection">2.4.8 Diary and Echo Commands</h4> <p><a name="index-diary-of-commands-and-output-142"></a><a name="index-command-and-output-logs-143"></a><a name="index-logging-commands-and-output-144"></a><a name="index-echoing-executing-commands-145"></a><a name="index-command-echoing-146"></a> Octave's diary feature allows you to keep a log of all or part of an interactive session by recording the input you type and the output that Octave produces in a separate file. <!-- pager.cc --> <p><a name="doc_002ddiary"></a> <div class="defun"> — Command: <b>diary</b><var> options<a name="index-diary-147"></a></var><br> <blockquote><p>Record a list of all commands <em>and</em> the output they produce, mixed together just as you see them on your terminal. Valid options are: <dl> <dt><code>on</code><dd>Start recording your session in a file called <samp><span class="file">diary</span></samp> in your current working directory. <br><dt><code>off</code><dd>Stop recording your session in the diary file. <br><dt><var>file</var><dd>Record your session in the file named <var>file</var>. </dl> <p>With no arguments, <code>diary</code> toggles the current diary state. </p></blockquote></div> <p>Sometimes it is useful to see the commands in a function or script as they are being evaluated. This can be especially helpful for debugging some kinds of problems. <!-- input.cc --> <p><a name="doc_002decho"></a> <div class="defun"> — Command: <b>echo</b><var> options<a name="index-echo-148"></a></var><br> <blockquote><p>Control whether commands are displayed as they are executed. Valid options are: <dl> <dt><code>on</code><dd>Enable echoing of commands as they are executed in script files. <br><dt><code>off</code><dd>Disable echoing of commands as they are executed in script files. <br><dt><code>on all</code><dd>Enable echoing of commands as they are executed in script files and functions. <br><dt><code>off all</code><dd>Disable echoing of commands as they are executed in script files and functions. </dl> <p class="noindent">With no arguments, <code>echo</code> toggles the current echo state. </p></blockquote></div> <!-- input.cc --> <p><a name="doc_002decho_005fexecuting_005fcommands"></a> <div class="defun"> — Built-in Function: <var>val</var> = <b>echo_executing_commands</b> ()<var><a name="index-echo_005fexecuting_005fcommands-149"></a></var><br> — Built-in Function: <var>old_val</var> = <b>echo_executing_commands</b> (<var>new_val</var>)<var><a name="index-echo_005fexecuting_005fcommands-150"></a></var><br> <blockquote><p>Query or set the internal variable that controls the echo state. It may be the sum of the following values: <dl> <dt>1<dd>Echo commands read from script files. <br><dt>2<dd>Echo commands from functions. <br><dt>4<dd>Echo commands read from command line. </dl> <p>More than one state can be active at once. For example, a value of 3 is equivalent to the command <kbd>echo on all</kbd>. <p>The value of <code>echo_executing_commands</code> may be set by the <kbd>echo</kbd> command or the command line option <code>--echo-commands</code>. </p></blockquote></div> </body></html>