File: Command-Line-Options.html

package info (click to toggle)
octave 6.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 124,192 kB
  • sloc: cpp: 322,665; ansic: 68,088; fortran: 20,980; objc: 8,121; sh: 7,719; yacc: 4,266; lex: 4,123; perl: 1,530; java: 1,366; awk: 1,257; makefile: 424; xml: 147
file content (382 lines) | stat: -rw-r--r-- 17,566 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Command Line Options (GNU Octave (version 6.2.0))</title>

<meta name="description" content="Command Line Options (GNU Octave (version 6.2.0))">
<meta name="keywords" content="Command Line Options (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Invoking-Octave-from-the-Command-Line.html" rel="up" title="Invoking Octave from the Command Line">
<link href="Startup-Files.html" rel="next" title="Startup Files">
<link href="Invoking-Octave-from-the-Command-Line.html" rel="prev" title="Invoking Octave from the Command Line">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<span id="Command-Line-Options"></span><div class="header">
<p>
Next: <a href="Startup-Files.html" accesskey="n" rel="next">Startup Files</a>, Up: <a href="Invoking-Octave-from-the-Command-Line.html" accesskey="u" rel="up">Invoking Octave from the Command Line</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="Command-Line-Options-1"></span><h4 class="subsection">2.1.1 Command Line Options</h4>
<span id="index-Octave-command-options"></span>
<span id="index-command-options"></span>
<span id="index-options_002c-Octave-command"></span>

<p>Here is a complete list of the command line options that Octave
accepts.
</p>

<dl compact="compact">
<dt><code>--built-in-docstrings-file <var>filename</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dbuilt_002din_002ddocstrings_002dfile--_002d_002dbuilt_002din_002ddocstrings_002dfile-filename"></span>
<p>Specify the name of the file containing documentation strings for the
built-in functions of Octave.  This value is normally correct and should
only need to specified in extraordinary situations.
</p>
</dd>
<dt><code>--debug</code></dt>
<dt><code>-d</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002ddebug--_002d_002ddebug"></span>
<span id="index-options_002c-Octave-command-_002dd--_002dd"></span>
<p>Enter parser debugging mode.  Using this option will cause Octave&rsquo;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.
</p>
</dd>
<dt><code>--debug-jit</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002ddebug_002djit--_002d_002ddebug_002djit"></span>
<p>Enable JIT compiler debugging and tracing.
</p>
</dd>
<dt><code>--doc-cache-file <var>filename</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002ddoc_002dcache_002dfile--_002d_002ddoc_002dcache_002dfile-filename"></span>
<p>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><span class="nolinebreak">OCTAVE_DOC_CACHE_FILE</span></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.
</p>
</dd>
<dt><code>--echo-commands</code></dt>
<dt><code>-x</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002decho_002dcommands--_002d_002decho_002dcommands"></span>
<span id="index-options_002c-Octave-command-_002dx--_002dx"></span>
<p>Echo commands as they are executed.
</p>
</dd>
<dt><code>--eval <var>code</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002deval--_002d_002deval-code"></span>
<p>Evaluate <var>code</var> and exit when finished unless <samp>--persist</samp> is also
specified.
</p>
</dd>
<dt><code>--exec-path <var>path</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dexec_002dpath--_002d_002dexec_002dpath-path"></span>
<p>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><span class="nolinebreak">OCTAVE_EXEC_PATH</span></code><!-- /@w --> found in the environment, but not any commands
in the system or user startup files that call the
<code><span class="nolinebreak">EXEC_PATH</span></code><!-- /@w --> function.
</p>
</dd>
<dt><code>--gui</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dgui--_002d_002dgui"></span>
<p>Start the graphical user interface (GUI).
</p>
</dd>
<dt><code>--help</code></dt>
<dt><code>-h</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dhelp--_002d_002dhelp"></span>
<span id="index-options_002c-Octave-command-_002dh--_002dh"></span>
<p>Print short help message and exit.
</p>
</dd>
<dt><code>--image-path <var>path</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dimage_002dpath--_002d_002dimage_002dpath-path"></span>
<p>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><span class="nolinebreak">OCTAVE_IMAGE_PATH</span></code><!-- /@w --> found in the environment, but not any commands
in the system or user startup files that call the <code><span class="nolinebreak">IMAGE_PATH</span></code><!-- /@w -->
function.
</p>
</dd>
<dt><code>--info-file <var>filename</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dinfo_002dfile--_002d_002dinfo_002dfile-filename"></span>
<p>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><span class="nolinebreak">OCTAVE_INFO_FILE</span></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.
</p>
</dd>
<dt><code>--info-program <var>program</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dinfo_002dprogram--_002d_002dinfo_002dprogram-program"></span>
<p>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><span class="nolinebreak">OCTAVE_INFO_PROGRAM</span></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.
</p>
</dd>
<dt><code>--interactive</code></dt>
<dt><code>-i</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dinteractive--_002d_002dinteractive"></span>
<span id="index-options_002c-Octave-command-_002di--_002di"></span>
<p>Force interactive behavior.  This can be useful for running Octave via a
remote shell command or inside an Emacs shell buffer.
</p>
</dd>
<dt><code>--jit-compiler</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002djit_002dcompiler--_002d_002djit_002dcompiler"></span>
<p>Enable the JIT compiler used for accelerating loops.
</p>
</dd>
<dt><code>--line-editing</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dline_002dediting--_002d_002dline_002dediting"></span>
<p>Force readline use for command-line editing.
</p>
</dd>
<dt><code>--no-gui</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dgui--_002d_002dno_002dgui"></span>
<p>Disable the graphical user interface (GUI) and use the command line
interface (CLI) instead.  This is the default behavior, but this option
may be useful to override a previous <samp>--gui</samp>.
</p>
</dd>
<dt><code>--no-history</code></dt>
<dt><code>-H</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dhistory--_002d_002dno_002dhistory"></span>
<span id="index-options_002c-Octave-command-_002dH--_002dH"></span>
<p>Disable recording of command-line history.
</p>
</dd>
<dt><code>--no-init-file</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dinit_002dfile--_002d_002dno_002dinit_002dfile"></span>
<span id="index-octaverc-_007e_002f_002eoctaverc_007e_002f_002eoctaverc"></span>
<span id="index-octaverc-_002eoctaverc_002eoctaverc"></span>
<p>Don&rsquo;t read the initialization files <samp>~/.octaverc</samp> and <samp>.octaverc</samp>.
</p>
</dd>
<dt><code>--no-init-path</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dinit_002dpath--_002d_002dno_002dinit_002dpath"></span>
<p>Don&rsquo;t initialize the search path for function files to include default
locations.
</p>
</dd>
<dt><code>--no-line-editing</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dline_002dediting--_002d_002dno_002dline_002dediting"></span>
<p>Disable command-line editing.
</p>
</dd>
<dt><code>--no-site-file</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dsite_002dfile--_002d_002dno_002dsite_002dfile"></span>
<span id="index-site-startup-file"></span>
<p>Don&rsquo;t read the site-wide <samp>octaverc</samp> initialization files.
</p>
</dd>
<dt><code>--no-window-system</code></dt>
<dt><code>-W</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dno_002dwindow_002dsystem--_002d_002dno_002dwindow_002dsystem"></span>
<span id="index-options_002c-Octave-command-_002dW--_002dW"></span>
<p>Disable use of a windowing system including graphics.  This forces a
strictly terminal-only environment.
</p>
</dd>
<dt><code>--norc</code></dt>
<dt><code>-f</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dnorc--_002d_002dnorc"></span>
<span id="index-options_002c-Octave-command-_002df--_002df"></span>
<p>Don&rsquo;t read any of the system or user initialization files at startup.
This is equivalent to using both of the options <samp>--no-init-file</samp>
and <samp>--no-site-file</samp>.
</p>
</dd>
<dt><code>--path <var>path</var></code></dt>
<dt><code>-p <var>path</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dpath--_002d_002dpath-path"></span>
<span id="index-options_002c-Octave-command-_002dp--_002dp-path"></span>
<p>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><span class="nolinebreak">OCTAVE_PATH</span></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.
</p>
</dd>
<dt><code>--persist</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dpersist--_002d_002dpersist"></span>
<p>Go to interactive mode after <samp>--eval</samp> or reading from a file
named on the command line.
</p>
</dd>
<dt><code>--silent</code></dt>
<dt><code>--quiet</code></dt>
<dt><code>-q</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dsilent--_002d_002dsilent"></span>
<span id="index-options_002c-Octave-command-_002d_002dquiet--_002d_002dquiet"></span>
<span id="index-options_002c-Octave-command-_002dq--_002dq"></span>
<p>Don&rsquo;t print the usual greeting and version message at startup.
</p>
</dd>
<dt><code>--texi-macros-file <var>filename</var></code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dtexi_002dmacros_002dfile--_002d_002dtexi_002dmacros_002dfile-filename"></span>
<p>Specify the name of the file containing Texinfo macros for use by makeinfo.
</p>
</dd>
<dt><code>--traditional</code></dt>
<dt><code>--braindead</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dtraditional--_002d_002dtraditional"></span>
<span id="index-options_002c-Octave-command-_002d_002dbraindead--_002d_002dbraindead"></span>
<p>For compatibility with <small>MATLAB</small>, set initial values for
user preferences to the following values
</p>
<div class="example">
<pre class="example">PS1                             = &quot;&gt;&gt; &quot;
PS2                             = &quot;&quot;
beep_on_error                   = true
confirm_recursive_rmdir         = false
crash_dumps_octave_core         = false
disable_diagonal_matrix         = true
disable_permutation_matrix      = true
disable_range                   = true
fixed_point_format              = true
history_timestamp_format_string = &quot;%%-- %D %I:%M %p --%%&quot;
print_empty_dimensions          = false
save_default_options            = &quot;-mat-binary&quot;
struct_levels_to_print          = 0
</pre></div>

<p>and disable the following warnings
</p>
<div class="example">
<pre class="example">Octave:abbreviated-property-match
Octave:colon-nonscalar-argument
Octave:data-file-in-path
Octave:function-name-clash
Octave:possible-matlab-short-circuit-operator
</pre></div>

<p>Note that this does not enable the <code>Octave:language-extension</code>
warning, which you might want if you want to be told about writing code
that works in Octave but not <small>MATLAB</small> (see <a href="Issuing-Warnings.html#XREFwarning">warning</a>,
<a href="Issuing-Warnings.html#XREFwarning_005fids">warning_ids</a>).
</p>
</dd>
<dt><code>--verbose</code></dt>
<dt><code>-V</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dverbose--_002d_002dverbose"></span>
<span id="index-options_002c-Octave-command-_002dV--_002dV"></span>
<p>Turn on verbose output.
</p>
</dd>
<dt><code>--version</code></dt>
<dt><code>-v</code></dt>
<dd><span id="index-options_002c-Octave-command-_002d_002dversion--_002d_002dversion"></span>
<span id="index-options_002c-Octave-command-_002dv--_002dv"></span>
<p>Print the program version number and exit.
</p>
</dd>
<dt><code><var>file</var></code></dt>
<dd><p>Execute commands from <var>file</var>.  Exit when done unless
<samp>--persist</samp> is also specified.
</p></dd>
</dl>

<p>Octave also includes several functions which return information
about the command line, including the number of arguments and all of the
options.
</p>
<span id="XREFargv"></span><dl>
<dt id="index-argv">: <em></em> <strong>argv</strong> <em>()</em></dt>
<dd><p>Return the command line arguments passed to Octave.
</p>
<p>For example, if you invoked Octave using the command
</p>
<div class="example">
<pre class="example">octave --no-line-editing --silent
</pre></div>

<p><code>argv</code> would return a cell array of strings with the elements
<samp>--no-line-editing</samp> and <samp>--silent</samp>.
</p>
<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</a>, for
an example of how to create an executable Octave script.
</p></dd></dl>


<span id="XREFprogram_005fname"></span><dl>
<dt id="index-program_005fname">: <em></em> <strong>program_name</strong> <em>()</em></dt>
<dd><p>Return the last component of the value returned by
<code>program_invocation_name</code>.
</p>
<p><strong>See also:</strong> <a href="#XREFprogram_005finvocation_005fname">program_invocation_name</a>.
</p></dd></dl>


<span id="XREFprogram_005finvocation_005fname"></span><dl>
<dt id="index-program_005finvocation_005fname">: <em></em> <strong>program_invocation_name</strong> <em>()</em></dt>
<dd><p>Return the name that was typed at the shell prompt to run Octave.
</p>
<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</a>, for an example of
how to create an executable Octave script.
</p>
<p><strong>See also:</strong> <a href="#XREFprogram_005fname">program_name</a>.
</p></dd></dl>


<p>Here is an example of using these functions to reproduce the command
line which invoked Octave.
</p>
<div class="example">
<pre class="example">printf (&quot;%s&quot;, program_name ());
arg_list = argv ();
for i = 1:nargin
  printf (&quot; %s&quot;, arg_list{i});
endfor
printf (&quot;\n&quot;);
</pre></div>

<p>See <a href="Indexing-Cell-Arrays.html">Indexing Cell Arrays</a>, for an explanation of how to retrieve objects
from cell arrays, and <a href="Defining-Functions.html">Defining Functions</a>, for information about the
variable <code>nargin</code>.
</p>
<hr>
<div class="header">
<p>
Next: <a href="Startup-Files.html" accesskey="n" rel="next">Startup Files</a>, Up: <a href="Invoking-Octave-from-the-Command-Line.html" accesskey="u" rel="up">Invoking Octave from the Command Line</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>