FAQ - Pass on command line arguments

:?: I want to start MatCalc and automatically run a script. How can I do this?

:?: I want to start MatCalc and pass on command line arguments, for instance, to restore window positions (see also FAQ - Window positions)

Diagnosis

  • Instruct MatCalc to perform some action on startup.

Background

By default, MatCalc displays the prompt and waits for user input when being started. This applies to the GUI version (“mcg”) as well as to the command line version (“mcc”). MatCalc can alternatively also be started with command line arguments that weill perform some predefined action. Typically, these are

  • pass on the name of a script file, which will be automatically executed.
  • use a command switch, such as, for instance, “/r” to restore window positions to their default values.

Passing on these arguments is different on Windows/Linux and Mac OS.

Remedy

FIXME

:!: Windows

  1. Open the command line application:
    • Type “mcg argument” or “mcc argument” in the command prompt separated by a blank. Replace “argument” by the specific term that you want to pass on to MatCalc. This can be either the name of a script or a switch, such as “/r”.
  2. Edit the Icon on the desktop to include
    • Linux: Start MatCalc with “./mcg” (from the current MatCalc directory) or “mcg” when installed in another folder with the path variable correctly set.

:!: Mac

  • Open the terminal.
  • Change directory to the MatCalc executable (“chdir path_to_matcalc”).
  • On the command prompt, enter “open -na mcg”
faq/mc_and_gui/mc_command_line_arguments.txt · Last modified: 2013/06/11 11:04 by ernst
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki