Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 3e60ff9d4d6f58c8fbd17208f14089fa > files > 102

octave-doc-3.2.3-3mdv2010.0.i586.rpm

<html lang="en">
<head>
<title>Command Line Options - 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="Invoking-Octave-from-the-Command-Line.html#Invoking-Octave-from-the-Command-Line" title="Invoking Octave from the Command Line">
<link rel="next" href="Startup-Files.html#Startup-Files" title="Startup Files">
<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="Command-Line-Options"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Startup-Files.html#Startup-Files">Startup Files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Invoking-Octave-from-the-Command-Line.html#Invoking-Octave-from-the-Command-Line">Invoking Octave from the Command Line</a>
<hr>
</div>

<h4 class="subsection">2.1.1 Command Line Options</h4>

<p><a name="index-Octave-command-options-27"></a><a name="index-command-options-28"></a><a name="index-options_002c-Octave-command-29"></a>
Here is a complete list of the command line options that Octave
accepts.

     <dl>
<dt><code>--debug</code><dt><code>-d</code><dd><a name="index-g_t_0040code_007b_002d_002ddebug_007d-30"></a><a name="index-g_t_0040code_007b_002dd_007d-31"></a>Enter parser debugging mode.  Using this option will cause Octave's
parser to print a lot of information about the commands it reads, and is
probably only useful if you are actually trying to debug the parser.

     <br><dt><code>--doc-cache-file </code><var>filename</var><dd><a name="index-g_t_0040code_007b_002d_002ddoc_002dcache_002dfile-_0040var_007bfilename_007d_007d-32"></a>Specify the name of the doc cache file to use.  The value of <var>filename</var>
specified on the command line will override any value of
<code>OCTAVE_DOC_CACHE_FILE</code><!-- /@w --> found in the environment, but not any commands
in the system or user startup files that use the <code>doc_cache_file</code>
function.

     <br><dt><code>--echo-commands</code><dt><code>-x</code><dd><a name="index-g_t_0040code_007b_002d_002decho_002dcommands_007d-33"></a><a name="index-g_t_0040code_007b_002dx_007d-34"></a>Echo commands as they are executed.

     <br><dt><code>--eval </code><var>code</var><dd>Evaluate <var>code</var> and exit when finished unless <code>--persist</code> is also
specified.

     <br><dt><code>--exec-path </code><var>path</var><dd><a name="index-g_t_0040code_007b_002d_002dexec_002dpath-_0040var_007bpath_007d_007d-35"></a>Specify the path to search for programs to run.  The value of <var>path</var>
specified on the command line will override any value of
<code>OCTAVE_EXEC_PATH</code><!-- /@w --> found in the environment, but not any commands
in the system or user startup files that set the built-in variable
<code>EXEC_PATH</code><!-- /@w -->.

     <br><dt><code>--help</code><dt><code>-h</code><dt><code>-?</code><dd><a name="index-g_t_0040code_007b_002d_002dhelp_007d-36"></a><a name="index-g_t_0040code_007b_002dh_007d-37"></a><a name="index-g_t_0040code_007b_002d_003f_007d-38"></a>Print short help message and exit.

     <br><dt><code>--image-path </code><var>path</var><dd><a name="index-g_t_0040code_007b_002d_002dimage_002dpath-_0040var_007bpath_007d_007d-39"></a>Add path to the head of the search path for images.  The value of
<var>path</var> specified on the command line will override any value of
<code>OCTAVE_IMAGE_PATH</code><!-- /@w --> found in the environment, but not any commands
in the system or user startup files that set the built-in variable
<code>IMAGE_PATH</code><!-- /@w -->.

     <br><dt><code>--info-file </code><var>filename</var><dd><a name="index-g_t_0040code_007b_002d_002dinfo_002dfile-_0040var_007bfilename_007d_007d-40"></a>Specify the name of the info file to use.  The value of <var>filename</var>
specified on the command line will override any value of
<code>OCTAVE_INFO_FILE</code><!-- /@w --> found in the environment, but not any commands
in the system or user startup files that use the <code>info_file</code>
function.

     <br><dt><code>--info-program </code><var>program</var><dd><a name="index-g_t_0040code_007b_002d_002dinfo_002dprogram-_0040var_007bprogram_007d_007d-41"></a>Specify the name of the info program to use.  The value of <var>program</var>
specified on the command line will override any value of
<code>OCTAVE_INFO_PROGRAM</code><!-- /@w --> found in the environment, but not any
commands in the system or user startup files that use the
<code>info_program</code> function.

     <br><dt><code>--interactive</code><dt><code>-i</code><dd><a name="index-g_t_0040code_007b_002d_002dinteractive_007d-42"></a><a name="index-g_t_0040code_007b_002di_007d-43"></a>Force interactive behavior.  This can be useful for running Octave via a
remote shell command or inside an Emacs shell buffer.  For another way
to run Octave within Emacs, see <a href="Emacs-Octave-Support.html#Emacs-Octave-Support">Emacs Octave Support</a>.

     <br><dt><code>--line-editing</code><dd><a name="index-g_t_0040code_007b_002d_002dline_002dediting_007d-44"></a>Force readline use for command-line editing.

     <br><dt><code>--no-history</code><dt><code>-H</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dhistory_007d-45"></a><a name="index-g_t_0040code_007b_002dH_007d-46"></a>Disable recording of command-line history.

     <br><dt><code>--no-init-file</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dinit_002dfile_007d-47"></a>Don't read the initialization files <samp><span class="file">~/.octaverc</span></samp> and <samp><span class="file">.octaverc</span></samp>.

     <br><dt><code>--no-init-path</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dinit_002dpath_007d-48"></a>Don't initialize the search path for function files to include default
locations.

     <br><dt><code>--no-line-editing</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dline_002dediting_007d-49"></a>Disable command-line editing.

     <br><dt><code>--no-site-file</code><dd><a name="index-g_t_0040code_007b_002d_002dno_002dsite_002dfile_007d-50"></a>Don't read the site-wide <samp><span class="file">octaverc</span></samp> initialization files.

     <br><dt><code>--norc</code><dt><code>-f</code><dd><a name="index-g_t_0040code_007b_002d_002dnorc_007d-51"></a><a name="index-g_t_0040code_007b_002df_007d-52"></a>Don't read any of the system or user initialization files at startup. 
This is equivalent to using both of the options <code>--no-init-file</code>
and <code>--no-site-file</code>.

     <br><dt><code>--path </code><var>path</var><dt><code>-p </code><var>path</var><dd><a name="index-g_t_0040code_007b_002d_002dpath-_0040var_007bpath_007d_007d-53"></a><a name="index-g_t_0040code_007b_002dp-_0040var_007bpath_007d_007d-54"></a>Add path to the head of the search path for function files.  The
value of <var>path</var> specified on the command line will override any value
of <code>OCTAVE_PATH</code><!-- /@w --> found in the environment, but not any commands in the
system or user startup files that set the internal load path through one
of the path functions.

     <br><dt><code>--persist</code><dd><a name="index-g_t_0040code_007b_002d_002dpersist_007d-55"></a>Go to interactive mode after <code>--eval</code> or reading from a file
named on the command line.

     <br><dt><code>--silent</code><dt><code>--quiet</code><dt><code>-q</code><dd><a name="index-g_t_0040code_007b_002d_002dsilent_007d-56"></a><a name="index-g_t_0040code_007b_002d_002dquiet_007d-57"></a><a name="index-g_t_0040code_007b_002dq_007d-58"></a>Don't print the usual greeting and version message at startup.

     <br><dt><code>--traditional</code><dt><code>--braindead</code><dd><a name="index-g_t_0040code_007b_002d_002dtraditional_007d-59"></a><a name="index-g_t_0040code_007b_002d_002dbraindead_007d-60"></a>For compatibility with <span class="sc">matlab</span>, set initial values for
user preferences to the following values

     <pre class="example">          PS1                     = "&gt;&gt; "
          PS2                     = ""
          beep_on_error           = true
          confirm_recursive_rmdir = false
          crash_dumps_octave_core = false
          default_save_options    = "-mat-binary"
          fixed_point_format      = true
          history_timestamp_format_string
                                  = "%%-- %D %I:%M %p --%%"
          page_screen_output      = false
          print_empty_dimensions  = false
</pre>
     <p class="noindent">and disable the following warnings
     <pre class="example">          Octave:fopen-file-in-path
          Octave:function-name-clash
          Octave:load-file-in-path
</pre>
     <br><dt><code>--verbose</code><dt><code>-V</code><dd><a name="index-g_t_0040code_007b_002d_002dverbose_007d-61"></a><a name="index-g_t_0040code_007b_002dV_007d-62"></a>Turn on verbose output.

     <br><dt><code>--version</code><dt><code>-v</code><dd><a name="index-g_t_0040code_007b_002d_002dversion_007d-63"></a><a name="index-g_t_0040code_007b_002dv_007d-64"></a>Print the program version number and exit.

     <br><dt><var>file</var><dd>Execute commands from <var>file</var>.  Exit when done unless
<code>--persist</code> is also specified. 
</dl>

   <p>Octave also includes several functions which return information
about the command line, including the number of arguments and all of the
options.

<!-- octave.cc -->
   <p><a name="doc_002dargv"></a>

<div class="defun">
&mdash; Built-in Function:  <b>argv</b> ()<var><a name="index-argv-65"></a></var><br>
<blockquote><p>Return the command line arguments passed to Octave.  For example,
if you invoked Octave using the command

     <pre class="example">          octave --no-line-editing --silent
</pre>
        <p class="noindent"><code>argv</code> would return a cell array of strings with the elements
<code>--no-line-editing</code> and <code>--silent</code>.

        <p>If you write an executable Octave script, <code>argv</code> will return the
list of arguments passed to the script.  See <a href="Executable-Octave-Programs.html#Executable-Octave-Programs">Executable Octave Programs</a>,
for an example of how to create an executable Octave script. 
</p></blockquote></div>

<!-- octave.cc -->
   <p><a name="doc_002dprogram_005fname"></a>

<div class="defun">
&mdash; Built-in Function:  <b>program_name</b> ()<var><a name="index-program_005fname-66"></a></var><br>
<blockquote><p>Return the last component of the value returned by
<code>program_invocation_name</code>. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dprogram_005finvocation_005fname.html#doc_002dprogram_005finvocation_005fname">program_invocation_name</a>. 
</p></blockquote></div>

<!-- octave.cc -->
   <p><a name="doc_002dprogram_005finvocation_005fname"></a>

<div class="defun">
&mdash; Built-in Function: program_invocation_name <b>(</b>)<var><a name="index-g_t_0028-67"></a></var><br>
<blockquote><p>Return the name that was typed at the shell prompt to run Octave.

        <p>If executing a script from the command line (e.g., <code>octave foo.m</code>)
or using an executable Octave script, the program name is set to the
name of the script.  See <a href="Executable-Octave-Programs.html#Executable-Octave-Programs">Executable Octave Programs</a>, for an example of
how to create an executable Octave script. 
<!-- Texinfo @sp should work but in practice produces ugly results for HTML. -->
<!-- A simple blank line produces the correct behavior. -->
<!-- @sp 1 -->

     <p class="noindent"><strong>See also:</strong> <a href="doc_002dprogram_005fname.html#doc_002dprogram_005fname">program_name</a>. 
</p></blockquote></div>

   <p>Here is an example of using these functions to reproduce the command
line which invoked Octave.

<pre class="example">     printf ("%s", program_name ());
     arg_list = argv ();
     for i = 1:nargin
       printf (" %s", arg_list{i});
     endfor
     printf ("\n");
</pre>
   <p class="noindent">See <a href="Indexing-Cell-Arrays.html#Indexing-Cell-Arrays">Indexing Cell Arrays</a>, for an explanation of how to retrieve objects
from cell arrays, and <a href="Defining-Functions.html#Defining-Functions">Defining Functions</a>, for information about the
variable <code>nargin</code>.

   </body></html>