| GNU Octave Manual by John W. Eaton Paperback (6"x9"), 324 pages, 4 figures ISBN 0954161726 RRP £19.99 ($29.99) |
2.1.1 Command Line Options
Here is a complete list of all the command line options that Octave accepts.
--debug-d- 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.
--echo-commands-x- Echo commands as they are executed.
--exec-path path-
Specify the path to search for programs to run. The value of path
specified on the command line will override any value of
OCTAVE_EXEC_PATHfound in the environment, but not any commands in the system or user startup files that set the built-in variableEXEC_PATH. --help-h-?- Print short help message and exit.
--info-file filename-
Specify the name of the info file to use. The value of filename
specified on the command line will override any value of
OCTAVE_INFO_FILEfound in the environment, but not any commands in the system or user startup files that set the built-in variableINFO_FILE. --info-program program-
Specify the name of the info program to use. The value of program
specified on the command line will override any value of
OCTAVE_INFO_PROGRAMfound in the environment, but not any commands in the system or user startup files that set the built-in variableINFO_PROGRAM. --interactive-i- 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 section D Emacs Octave Support.
--no-init-file- Don't read the ‘~/.octaverc’ or ‘.octaverc’ files.
--no-line-editing- Disable command-line editing.
--no-site-file- Don't read the site-wide ‘octaverc’ file.
--norc-f-
Don't read any of the system or user initialization files at startup.
This is equivalent to using both of the options
--no-init-fileand--no-site-file. --path path-p path-
Specify the path to search for function files. The value of path
specified on the command line will override any value of
OCTAVE_PATHfound in the environment, but not any commands in the system or user startup files that set the built-in variableLOADPATH. --silent--quiet-q- Don't print the usual greeting and version message at startup.
--traditional--braindead-
Set initial values for user-preference variables to the following
values for compatibility with MATLAB.
PS1 = ">> " PS2 = "" beep_on_error = 1 default_save_format = "mat-binary" define_all_return_values = 1 do_fortran_indexing = 1 crash_dumps_octave_core = 0 empty_list_elements_ok = 1 implicit_str_to_num_ok = 1 ok_to_lose_imaginary_part = 1 page_screen_output = 0 prefer_column_vectors = 0 print_empty_dimensions = 0 treat_neg_dim_as_zero = 1 warn_function_name_clash = 0 whitespace_in_literal_matrix = "traditional"
--verbose-V- Turn on verbose output.
--version-v- Print the program version number and exit.
file- Execute commands from file.
Octave also includes several built-in variables that contain information about the command line, including the number of arguments and all of the options.
- Built-in Variable: argv
- The command line arguments passed to Octave are available in this
variable. For example, if you invoked Octave using the command
octave --no-line-editing --silent
argvwould be a string vector with the elements--no-line-editingand--silent.If you write an executable Octave script,
argvwill contain the list of arguments passed to the script. see section 2.6 Executable Octave Programs.
- Built-in Variable: program_invocation_name
- Built-in Variable: program_name
- When Octave starts, the value of the built-in variable
program_invocation_nameis automatically set to the name that was typed at the shell prompt to run Octave, and the value ofprogram_nameis automatically set to the final component ofprogram_invocation_name. For example, if you typed ‘/usr/local/bin/octave’ to start Octave,program_invocation_namewould have the value"/usr/local/bin/octave", andprogram_namewould have the value"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 2.6 Executable Octave Programs for an example of how to create an executable Octave script.
Here is an example of using these variables to reproduce Octave's command line.
printf ("%s", program_name);
for i = 1:nargin
printf (" %s", argv(i,:));
endfor
printf ("\n");
See section 8.1 Index Expressions for an explanation of how to properly index
arrays of strings and substrings in Octave, and See section 11.1 Defining Functions
for information about the variable nargin.
| ISBN 0954161726 | GNU Octave Manual | See the print edition |