| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Normally, Octave is used interactively by running the program `octave' without any arguments. Once started, Octave reads commands from the terminal until you tell it to exit.
You can also specify the name of a file on the command line, and Octave will read and execute the commands from the named file and then exit when it is finished.
You can further control how Octave starts by using the command-line options described in the next section, and Octave itself can remind you of the options available. Type `octave --help' to display all available options and briefly describe their use (`octave -h' is a shorter equivalent).
| 2.1.1 Command Line Options | ||
| 2.1.2 Startup Files |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Here is a complete list of all the command line options that Octave accepts.
--debug-dEnter 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.
--echo-commands-xEcho commands as they are executed.
--eval codeEvaluate code and exit when done unless --persist is also
specified.
--exec-path pathSpecify the path to search for programs to run. The value of path
specified on the command line will override any value of
OCTAVE_EXEC_PATH found in the environment, but not any commands
in the system or user startup files that set the built-in variable
EXEC_PATH.
--help-h-?Print short help message and exit.
--image-path pathSpecify the path to search for images. The value of path
specified on the command line will set the value of
IMAGE_PATH found in the environment.
--info-file filenameSpecify the name of the info file to use. The value of filename
specified on the command line will override any value of
OCTAVE_INFO_FILE found in the environment, but not any commands
in the system or user startup files that use the info_file
function.
--info-program programSpecify the name of the info program to use. The value of program
specified on the command line will override any value of
OCTAVE_INFO_PROGRAM found in the environment, but not any
commands in the system or user startup files that use the
info_program function.
--interactive-iForce 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 Emacs Octave Support.
--no-history-HDisable command-line history.
--no-init-fileDon't read the `~/.octaverc' or `.octaverc' files.
--no-line-editingDisable command-line editing.
--no-site-fileDon't read the site-wide `octaverc' file.
--norc-fDon't read any of the system or user initialization files at startup.
This is equivalent to using both of the options --no-init-file
and --no-site-file.
--path path-p pathSpecify the path to search for function files. The value of path
specified on the command line will override any value of
OCTAVE_PATH 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.
--persistGo to interactive mode after --eval or reading from a file
named on the command line.
--silent--quiet-qDon't print the usual greeting and version message at startup.
--traditional--braindeadFor compatibility with MATLAB, set initial values for user-preferences to the following values
PS1 = ">> "
PS2 = ""
beep_on_error = true
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
|
and disable the following warnings
Octave:fopen-file-in-path Octave:function-name-clash Octave:load-file-in-path |
--verbose-VTurn on verbose output.
--version-vPrint the program version number and exit.
fileExecute commands from file. Exit when done unless
--persist is also specified.
Octave also includes several built-in variables that contain information about the command line, including the number of arguments and all of the options.
Return the command line arguments passed to Octave. For example, if you invoked Octave using the command
octave --no-line-editing --silent |
argv would return a cell array of strings with the elements
--no-line-editing and --silent.
If you write an executable Octave script, argv will return the
list of arguments passed to the script. See section Executable Octave Programs,
for an example of how to create an executable Octave script.
Return the last component of of the value returned by
program_invocation_name.
See also: program_invocation_name.
Return the name that was typed at the shell prompt to run Octave.
If executing a script from the command line (e.g., octave foo.m)
or using an executable Octave script, the program name is set to the
name of the script. See section Executable Octave Programs, for an example of
how to create an executable Octave script.
See also: program_name.
Here is an example of using these functions to reproduce Octave's command line.
printf ("%s", program_name ());
arg_list = argv ();
for i = 1:nargin
printf (" %s", arg_list{i});
endfor
printf ("\n");
|
See section Index Expressions, for an explanation of how to properly index
arrays of strings and substrings in Octave, and See section Defining Functions,
for information about the variable nargin.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
When Octave starts, it looks for commands to execute from the files in the following list. These files may contain any valid Octave commands, including function definitions.
octave-home/share/octave/site/m/startup/octavercWhere octave-home is the directory in which all of Octave is installed (the default is `/usr/local'). This file is provided so that changes to the default Octave environment can be made globally for all users at your site for all versions of Octave you have installed. Some care should be taken when making changes to this file, since all users of Octave at your site will be affected.
octave-home/share/octave/version/m/startup/octavercWhere octave-home is the directory in which all of Octave is installed (the default is `/usr/local'), and version is the version number of Octave. This file is provided so that changes to the default Octave environment can be made globally for all users for a particular version of Octave. Some care should be taken when making changes to this file, since all users of Octave at your site will be affected.
~/.octavercThis file is normally used to make personal changes to the default Octave environment.
.octavercThis file can be used to make changes to the default Octave environment
for a particular project. Octave searches for this file in the current
directory after it reads `~/.octaverc'. Any use of the cd
command in the `~/.octaverc' file will affect the directory that
Octave searches for the file `.octaverc'.
If you start Octave in your home directory, commands from from the file `~/.octaverc' will only be executed once.
A message will be displayed as each of the startup files is read if you
invoke Octave with the --verbose option but without the
--silent option.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] |
This document was generated on December, 26 2007 using texi2html 1.76.