flag to force scilab exit after -e or -f execution added.
[scilab.git] / scilab / modules / core / help / en_US / scilab.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="scilab" xml:lang="en">
3     <refnamediv>
4         <refname>scilab</refname>
5         <refpurpose>Main script to start Scilab and miscellaneous
6             tools (GNU/Linux, Unix and Mac OS X)
7         </refpurpose>
8     </refnamediv>
9     <refsynopsisdiv>
10         <title>Calling Sequence</title>
11         <synopsis>scilab &lt;Options&gt;
12             scilab-adv-cli &lt;Options&gt;
13             scilab-cli &lt;Options&gt;
14         </synopsis>
15     </refsynopsisdiv>
16     <refsection role="arguments">
17         <title>Arguments</title>
18         <variablelist>
19             <varlistentry>
20                 <term>-args Arguments</term>
21                 <listitem>
22                     <para>If this option is present, arguments are passed to Scilab.
23                         They can then be got by <link linkend="sciargs">sciargs</link>
24                         function. For multi arguments passing use a quoted, blank separated
25                         sequence of words like: <literal>scilab -args 'foo1
26                             foo2'
27                         </literal>
28                         .Without this option, unknown arguments will not
29                         be accepted.
30                     </para>
31                 </listitem>
32             </varlistentry>
33             <varlistentry>
34                 <term>-display Display</term>
35                 <listitem>
36                     <para>
37                         For use under Xwindow systems only to set a specific X server
38                         display. Default display is unix:0.0.
39                     </para>
40                     <para>
41                         <literal>-display</literal> can be abbreviated by
42                         <literal>-d</literal>.
43                     </para>
44                 </listitem>
45             </varlistentry>
46             <varlistentry>
47                 <term>-debug</term>
48                 <listitem>
49                     <para>Start Scilab under the debugger gdb (Unix/Linux/Mac OS X only).</para>
50                     <para>
51                         Define the variable <literal>SCILAB_GDB_OPT</literal> to add custom options to
52                         gdb.
53                     </para>
54                     <para>Advise: use this option on a Scilab source tree.</para>
55                 </listitem>
56             </varlistentry>
57             <varlistentry>
58                 <term>-debug-kdbg</term>
59                 <listitem>
60                     <para>Start Scilab under kdbg (Unix/Linux/Mac OS X only).</para>
61                     <para>Advise: use this option on a Scilab source tree.</para>
62                 </listitem>
63             </varlistentry>
64             <varlistentry>
65                 <term>-profiling</term>
66                 <listitem>
67                     <para>Start Scilab under valgrind (Unix/Linux/Mac OS X only).</para>
68                     <para>Define the variable SCILAB_VALGRIND_OPT to add custom options
69                         to valgrind (and override the existing valgrind options).
70                     </para>
71                     <para>Advise: use this option on a Scilab source tree.</para>
72                 </listitem>
73             </varlistentry>
74             <varlistentry>
75                 <term>-profiling-visu</term>
76                 <listitem>
77                     <para>Start Scilab under callgrind (Unix/Linux/Mac OS X only).</para>
78                     <para>Define the variable SCILAB_VALGRIND_OPT to add custom options
79                         to callgrind (and override the existing callgrind options).
80                     </para>
81                     <para>Advise: use this option on a Scilab source tree.</para>
82                 </listitem>
83             </varlistentry>
84             <varlistentry>
85                 <term>-electric-fence</term>
86                 <listitem>
87                     <para>Start Scilab with the Electric Fence (Unix/Linux/Mac OS X only).</para>
88                     <para>Advise: use this option on a Scilab source tree.</para>
89                 </listitem>
90             </varlistentry>
91             <varlistentry>
92                 <term>-e Instruction</term>
93                 <listitem>
94                     <para>If this option is present then Scilab instruction
95                         <literal>Instruction</literal> is executed first (just after startup
96                         file execution) into Scilab. <literal>-e</literal> and
97                         <literal>-f</literal> options are mutually exclusive.
98                     </para>
99                     <para>
100                         Note that several instructions can be used in with <literal>-e</literal>.
101                     </para>
102                     <programlisting role="no-scilab-exec">scilab-cli -e  "a=1+%i; aPlusPi=a+%pi; disp(aPlusPi);exit;" -nb</programlisting>
103                 </listitem>
104             </varlistentry>
105             <varlistentry>
106                 <term>-f file</term>
107                 <listitem>
108                     <para>If this option is present then Scilab script
109                         <literal>file</literal> is executed first (just after startup file
110                         execution) into Scilab. <literal>-e</literal> and
111                         <literal>-f</literal> options are mutually exclusive.
112                     </para>
113                     <para>A file with .xcos extension will be opened by Xcos.</para>
114                 </listitem>
115             </varlistentry>
116             <varlistentry>
117                 <term>-quit</term>
118                 <listitem>
119                     This option forces scilab to always exit after the instruction(s) passed with the <literal>-e</literal>
120                     option, or the script referred to by the <literal>-f</literal> option, have been executed,
121                     even in case of a runtime error. This option should always be used in batch mode.
122                     It is ignored if neither <literal>-e</literal> nor <literal>-f</literal> options are present.
123                     </para>
124                 </listitem>
125             </varlistentry>
126             <varlistentry>
127                 <term>-l lang</term>
128                 <listitem>
129                     <para>If this option is present it fixes the user language.
130                         <emphasis>lang</emphasis> can be: <emphasis>ca_ES de_DE en_US es_ES
131                             fr_FR ja_JP pt_BR ru_RU zh_CN zh_TW
132                         </emphasis>
133                         (from Scilab
134                         5.2).
135                     </para>
136                     <para>
137                         Other possible <literal>lang</literal> values are
138                         <literal>'fr'</literal> for french and <literal>'en'</literal> for
139                         English for compatibility reasons. The default language is English.
140                         This default value is fixed the <literal>scilab.start</literal>
141                         file.
142                     </para>
143                     <para>On some systems, locales must be compiled to render correctly
144                         UTF-8 fonts.
145                     </para>
146                     <para>Scilab can be also called the following way:</para>
147                     <programlisting role="no-scilab-exec">LANG=ja_JP scilab
148                         # equivalent to
149                         scilab -l ja_JP
150                     </programlisting>
151                 </listitem>
152             </varlistentry>
153             <varlistentry>
154                 <term>-nb</term>
155                 <listitem>
156                     <para>If this option is present then the Scilab loading message not displayed.
157                     </para>
158                 </listitem>
159             </varlistentry>
160             <varlistentry>
161                 <term>-ns</term>
162                 <listitem>
163                     <para>If this option is present the startup file
164                         <literal>SCI/etc/scilab.start</literal> and the user startup files
165                         <literal>SCIHOME/.scilab</literal>,
166                         <literal>SCIHOME/scilab.ini</literal> are not executed.
167                     </para>
168                     <para>This option will disable many features in Scilab (Only use if
169                         you know what you are doing).
170                     </para>
171                 </listitem>
172             </varlistentry>
173             <varlistentry>
174                 <term>-nouserstartup</term>
175                 <listitem>
176                     <para>If this option is present the user startup files
177                         <literal>SCIHOME/.scilab</literal>,
178                         <literal>SCIHOME/scilab.ini</literal> are not executed.
179                     </para>
180                 </listitem>
181             </varlistentry>
182             <varlistentry>
183                 <term>-noatomsautoload</term>
184                 <listitem>
185                     <para>If this option is present the ATOMS modules previously installed are not loaded for this session.</para>
186                 </listitem>
187             </varlistentry>
188             <varlistentry>
189                 <term>-nw</term>
190                 <listitem>
191                     <para>If this option is present, Scilab is started as command line
192                         with advanced features still available (graphics, export, xcos, scinotes, help browser, ...).
193                     </para>
194                     <para>
195                         This option may be used with <literal>-f</literal> or <literal>-e</literal> options.
196                     </para>
197                     <para>From Scilab 5.2:</para>
198                     <itemizedlist>
199                         <listitem>
200                             <para>Scilab distribution also provides a dedicated binary which
201                                 is doing the same as <literal>-nw</literal>: <literal>scilab-adv-cli</literal> (Scilab Advanced
202                                 Command Line Interpreter).
203                             </para>
204                         </listitem>
205                         <listitem>
206                             <para>pipes are enabled for all operating systems (see the
207                                 examples for further details).
208                             </para>
209                         </listitem>
210                     </itemizedlist>
211                 </listitem>
212             </varlistentry>
213             <varlistentry>
214                 <term>-nwni / -nogui</term>
215                 <listitem>
216                     <para>If this option is present, Scilab is started as command line
217                         without advanced features (graphics, export, xcos, scinotes, help browser, ...).
218                     </para>
219                     <para>
220                         This option may be used with <literal>-f</literal> or <literal>-e</literal> options.
221                     </para>
222                     <para>From Scilab 5.2:</para>
223                     <itemizedlist>
224                         <listitem>
225                             <para>Scilab distribution also provides a dedicated binary which
226                                 is doing the same as <literal>-nwni</literal>: <literal>scilab-cli</literal> (Scilab Command Line Interpreter).
227                             </para>
228                         </listitem>
229                     </itemizedlist>
230                     <itemizedlist>
231                         <listitem>
232                             <para>pipes are enabled for all operating systems (see the
233                                 examples for further details).
234                             </para>
235                         </listitem>
236                     </itemizedlist>
237                     <para>This mode does not load the Java Virtual Machine (faster to
238                         start and uses less memory).
239                     </para>
240                 </listitem>
241             </varlistentry>
242             <varlistentry>
243                 <term>--texmacs</term>
244                 <listitem>
245                     <para>This option is reserved for TeXMacs.</para>
246                     <para>
247                         Please install ATOMS module: <programlisting role="">atomsInstall('texmacs')</programlisting>
248                     </para>
249                 </listitem>
250             </varlistentry>
251             <varlistentry>
252                 <term>-version</term>
253                 <listitem>
254                     <para>This option prints product version and exits.</para>
255                 </listitem>
256             </varlistentry>
257         </variablelist>
258     </refsection>
259     <refsection role="description">
260         <title>Description of environment variables</title>
261         <variablelist>
262             <varlistentry>
263                 <term>SCIVERBOSE</term>
264                 <listitem>
265                     <para>
266                         If this variable is present, Scilab startup script will show a startup debug information.
267                         Mainly used for bug report and debugging purposes.
268                     </para>
269                 </listitem>
270             </varlistentry>
271             <varlistentry>
272                 <term>JAVA_HOME</term>
273                 <listitem>
274                     <para>
275                         Specify which Java to use. For example,
276                         <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> will start Scilab with Java 7.
277                     </para>
278                 </listitem>
279             </varlistentry>
280             <varlistentry>
281                 <term>SCI_DISABLE_TK</term>
282                 <listitem>
283                     <para>Disable Tk (but not Tcl) features.</para>
284                 </listitem>
285             </varlistentry>
286             <varlistentry>
287                 <term>SCI_JAVA_ENABLE_HEADLESS</term>
288                 <listitem>
289                     <para>
290                         Enable Java Headless VM (i.e. without GUI features).
291                     </para>
292                 </listitem>
293             </varlistentry>
294         </variablelist>
295     </refsection>
296     <refsection role="description">
297         <title>Java Virtual Machine options</title>
298         <para>Starting from Scilab 5.0, the graphical user interface (GUI) and the
299             build documentation are based on Java features. In some cases, it can be
300             important to edit the JVM options (Java Virtual Machine).
301         </para>
302         <para>These options are available in the
303             <emphasis>jvm_options.xml</emphasis> file.
304         </para>
305         <para>In version 5.0.X and 5.1.X, this file is stored as
306             <emphasis>SCI/modules/jvm/etc/jvm_options.xml</emphasis>.
307         </para>
308         <para>In version &gt;= 5.2.0, the file is available in
309             <emphasis>etc/jvm_options.xml</emphasis>.
310         </para>
311         <para>
312             <emphasis>
313                 By default, the three following options are
314                 easily accessible in the configuration file:
315             </emphasis>
316         </para>
317         <variablelist>
318             <varlistentry>
319                 <term>-XmxXXXm</term>
320                 <listitem>
321                     <para>This option set the amount of memory available by the Java
322                         Virtual Machine. By default, 256M are allocated. If you change this
323                         value, check that the value does not exceed the memory available on
324                         the system.
325                     </para>
326                     <para>Since Scilab 5.4.0, this value can be changed in the preferences menu.</para>
327                 </listitem>
328             </varlistentry>
329             <varlistentry>
330                 <term>-Djava.compiler=JIT</term>
331                 <listitem>
332                     <para>
333                         This option with the argument <emphasis>JIT</emphasis> enables
334                         the Java Just In Time compiler. It is activated by default.
335                         <emphasis>NONE</emphasis> disables the JIT and decreases
336                         dramatically performances.
337                     </para>
338                 </listitem>
339             </varlistentry>
340             <varlistentry>
341                 <term>-verbose:jni / -Xcheck:jni</term>
342                 <listitem>
343                     <para>These options enable more checks and output from the JNI
344                         calls. These options are useful in case of debugging and are
345                         disabled by default since they decreases performances.
346                     </para>
347                 </listitem>
348             </varlistentry>
349         </variablelist>
350         <para>Many more options are available. They can improve the performances,
351             change look and feel, change memory managements... See: <ulink url="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html">http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</ulink>.
352         </para>
353     </refsection>
354     <refsection role="examples">
355         <title>Examples</title>
356         <programlisting role="no-scilab-exec"><![CDATA[
357 # Let's start Scilab in profiling mode without attaching a gdb once a SIGSEGV is met.
358 # We are under Bash shell
359 export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
360 scilab -profiling
361
362 # Let's start Scilab in debug mode without stopping after each SIGSEGV
363 # First, we write a small command file
364 echo "handle SIGSEGV nostop" &> debug.txt
365 # Now set the custom option
366 # We are under Bash shell
367 export SCILAB_GDB_OPT="--command=debug.txt"
368 # Start Scilab in debug mode
369 scilab -debug]]></programlisting>
370         <programlisting role="no-scilab-exec"><![CDATA[
371 # Under GNU/Linux, Mac OS X or Unix:
372 $ echo "disp(%pi)"|scilab-cli
373 or
374 $ echo "disp(%pi)"|scilab -nwni
375
376 # Only open the Scilab help window:
377 $ scilab-adv-cli -e "help()"
378 or
379 $ scilab -nw -e "help()"
380
381
382 # Scilab can be used for scripting aspects:
383 echo "if 1<>2 then exit(99) end"|scilab-cli
384 echo $? ]]></programlisting>
385     </refsection>
386     <refsection role="see also">
387         <title>See Also</title>
388         <simplelist type="inline">
389             <member>
390                 <link linkend="exit">exit</link>
391             </member>
392             <member>
393                 <link linkend="startup">startup</link>
394             </member>
395         </simplelist>
396     </refsection>
397     <refsection role="history">
398         <title>History</title>
399         <revhistory>
400             <revision>
401                 <revnumber>5.4.0</revnumber>
402                 <revremark>-noatomsautoload added.</revremark>
403             </revision>
404             <revision>
405                 <revnumber>5.4.1</revnumber>
406                 <revremark>scinotes and xcos individual scripts introduced. See SEP #87.</revremark>
407             </revision>
408             <revision>
409                 <revnumber>6.0.0</revnumber>
410                 <revremark>
411                     <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
412                 </revremark>
413             </revision>
414         </revhistory>
415     </refsection>
416 </refentry>